ReactOS  0.4.14-dev-41-g31d7680
MainWindow.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Device Manager
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: dll/win32/devmgr/devmgmt/MainWindow.cpp
5  * PURPOSE: Implements the main container window for the device view
6  * COPYRIGHT: Copyright 2014 - 2015 Ged Murphy <gedmurphy@reactos.org>
7  */
8 
9 
10 #include "precomp.h"
11 #include "devmgmt.h"
12 #include "MainWindow.h"
13 
14 
15 /* DATA *****************************************************/
16 
17 #define BTN_PROPERTIES 0
18 #define BTN_SCAN_HARDWARE 1
19 #define BTN_ENABLE_DRV 2
20 #define BTN_DISABLE_DRV 3
21 #define BTN_UPDATE_DRV 4
22 #define BTN_UNINSTALL_DRV 5
23 
24 #define REFRESH_TIMER 1
25 
28 
29 // menu hints
30 static const MENU_HINT MainMenuHintTable[] =
31 {
32  // File Menu
34 
35  // Action Menu
43 
44  // View Menu
50 
52 
53 };
54 
55 
56 // system menu hints
58 {
65 };
66 
67 static TBBUTTON TbButtons[] =
68 {
71  { 2, IDC_STATIC, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 },
76 };
77 
78 
79 /* PUBLIC METHODS **********************************************/
80 
82  m_hMainWnd(NULL),
83  m_hStatusBar(NULL),
84  m_hToolBar(NULL),
85  m_CmdShow(0),
86  m_RefreshPending(false)
87 {
88  m_szMainWndClass = L"DevMgmtWndClass";
89 }
90 
92 {
93 }
94 
95 bool
98  _In_opt_z_ LPCWSTR /*lpMachineName*/,
99  _In_ int nCmdShow)
100 {
101  CDeviceManager MainWindow;
104  int Ret = 1;
105 
106  // Store the instances
108  g_hThisInstance = GetModuleHandleW(L"devmgr.dll");
109 
110  // Initialize common controls
111  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
113  InitCommonControlsEx(&icex);
114 
115  // Load the application name
116  if (szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
117  {
118  // Initialize the main window
119  if (MainWindow.Initialize(szAppName, nCmdShow))
120  {
121  // Run the application
122  Ret = MainWindow.Run();
123 
124  // Uninitialize the main window
125  MainWindow.Uninitialize();
126  }
127  }
128 
129  return (Ret == 0);
130 }
131 
132 
133 /* PRIVATE METHODS **********************************************/
134 
135 bool
137  _In_ int nCmdShow)
138 {
139  CAtlStringW szCaption;
140  WNDCLASSEXW wc = {0};
141 
142  // Store the show window value
143  m_CmdShow = nCmdShow;
144 
145  // Setup the window class struct
146  wc.cbSize = sizeof(WNDCLASSEXW);
151  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
156  IMAGE_ICON,
159  0);
160 
161  // Register the window
162  if (RegisterClassExW(&wc))
163  {
164  // Create the main window and store the object pointer
167  lpCaption,
171  550,
172  500,
173  NULL,
174  NULL,
176  this);
177  }
178 
179  // Return creation result
180  return !!(m_hMainWnd);
181 }
182 
183 void
185 {
186  // Unregister the window class
188 }
189 
190 int
192 {
193  MSG Msg;
194 
195  // Pump the message queue
196  while (GetMessageW(&Msg, NULL, 0, 0 ) != 0)
197  {
200  }
201 
202  return 0;
203 }
204 
205 bool
207  _In_ const MENU_HINT *HintArray,
208  _In_ DWORD HintsCount,
209  _In_ UINT DefHintId)
210 {
211  bool Found = false;
212  const MENU_HINT *LastHint;
213  UINT HintId = DefHintId;
214 
215  LastHint = HintArray + HintsCount;
216  while (HintArray != LastHint)
217  {
218  if (HintArray->CmdId == CmdId)
219  {
220  HintId = HintArray->HintId;
221  Found = true;
222  break;
223  }
224  HintArray++;
225  }
226 
228  SB_SIMPLEID,
230  HintId);
231 
232  return Found;
233 }
234 
235 void
237 {
239  SB_SIMPLE,
240  (WPARAM)InMenuLoop,
241  0);
242 }
243 
244 bool
246  _In_ bool ScanForChanges)
247 {
248  UINT CheckId = 0;
249 
250  // Refreshed the cached view
251  m_DeviceView->Refresh(Type, ScanForChanges, true);
252 
253  // Get the menu item id
254  switch (Type)
255  {
256  case DevicesByType:
257  CheckId = IDM_DEVBYTYPE;
258  break;
259 
260  case DevicesByConnection:
261  CheckId = IDM_DEVBYCONN;
262  break;
263 
264  case ResourcesByType:
265  CheckId = IDM_RESBYTYPE;
266  break;
267 
269  CheckId = IDM_RESBYCONN;
270  break;
271 
272  default:
273  ATLASSERT(FALSE);
274  break;
275  }
276 
277  // Set the new check item
281  CheckId,
282  MF_BYCOMMAND);
283 
284  return true;
285 }
286 
287 bool
289 {
290  TBADDBITMAP TbAddBitmap;
291 
294 
295  // Create the toolbar window
296  m_hToolBar = CreateWindowExW(dwExStyles,
298  NULL,
299  dwStyles,
300  0, 0, 0, 0,
301  m_hMainWnd,
304  NULL);
305  if (m_hToolBar == NULL)
306  return FALSE;
307 
308  // Don't show clipped buttons
311  0,
313 
315 
316  // Set the struct size, the toobar needs this...
319  sizeof(TBBUTTON),
320  0);
321 
322  TbAddBitmap.hInst = g_hThisInstance;
323  TbAddBitmap.nID = IDB_TOOLBAR;
325 
328 
329  if (TRUE)
330  {
332  }
333 
334  return TRUE;
335 }
336 
337 bool
339 {
340  int StatWidths[] = {110, -1}; // widths of status bar
341  bool bRet = FALSE;
342 
343  // Create the status bar
346  NULL,
348  0, 0, 0, 0,
349  m_hMainWnd,
352  NULL);
353  if (m_hStatusBar)
354  {
355  // Set the width
356  bRet = (SendMessageW(m_hStatusBar,
357  SB_SETPARTS,
358  sizeof(StatWidths) / sizeof(int),
359  (LPARAM)StatWidths) != 0);
360  }
361 
362  return bRet;
363 }
364 
366 {
367  WORD State;
368 
370 
371  // properties button
372  if (Node->HasProperties())
373  {
375  }
376  else
377  {
379  }
383 
384  // enable driver button
385  if (Node->GetNodeType() == DeviceNode &&
386  dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
387  {
389  }
390  else
391  {
393  }
395 
396  // disable driver button
397  if (Node->GetNodeType() == DeviceNode &&
398  dynamic_cast<CDeviceNode *>(Node)->CanDisable() &&
399  !dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
400  {
402  }
403  else
404  {
406  }
408 }
409 
410 bool
412  _In_ INT PartId,
414  _In_ UINT uID)
415 {
416  CAtlStringW szMessage;
417  bool bRet = false;
418 
419  // Load the string
420  if (szMessage.LoadStringW(hInstance, uID))
421  {
422  // Show the string on the status bar
423  bRet = (SendMessageW(hStatusBar,
424  SB_SETTEXT,
425  (WPARAM)PartId,
426  (LPARAM)szMessage.GetBuffer()) != 0);
427  }
428 
429  return bRet;
430 }
431 
432 LRESULT
434 {
435  LRESULT RetCode;
436 
437  RetCode = -1;
438  m_hMainWnd = hwnd;
439 
440  // Store a handle to the main menu
442 
443  // Create the toolbar and statusbar
444  if (CreateToolBar() && CreateStatusBar())
445  {
446  // Create the device view object
448  if (m_DeviceView->Initialize())
449  {
450  // Do the initial scan
452 
453  // Display the window according to the user request
455  RetCode = 0;
456  }
457  }
458 
459  return RetCode;
460 }
461 
462 LRESULT
464 {
465  RECT rcClient, rcTool, rcStatus;
466  INT lvHeight, iToolHeight, iStatusHeight;
467 
468  // Autosize the toolbar
470 
471  // Get the toolbar rect and save the height
472  GetWindowRect(m_hToolBar, &rcTool);
473  iToolHeight = rcTool.bottom - rcTool.top;
474 
475  // Resize the status bar
477 
478  // Get the statusbar rect and save the height
479  GetWindowRect(m_hStatusBar, &rcStatus);
480  iStatusHeight = rcStatus.bottom - rcStatus.top;
481 
482  // Get the full client rect
483  GetClientRect(m_hMainWnd, &rcClient);
484 
485  // Calculate the remaining height for the treeview
486  lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
487 
488  // Resize the device view
489  m_DeviceView->OnSize(0,
490  iToolHeight,
491  rcClient.right,
492  lvHeight);
493 
494  return 0;
495 }
496 
497 LRESULT
499 {
500  LPNMHDR NmHdr = (LPNMHDR)lParam;
501  LRESULT Ret = 0;
502 
503  switch (NmHdr->code)
504  {
505  case TVN_SELCHANGED:
506  {
507  HMENU hMenu = GetSubMenu(m_hMenu, 1);
508  for (INT i = GetMenuItemCount(hMenu) - 1; i >= 0; i--)
509  {
510  DeleteMenu(hMenu, i, MF_BYPOSITION);
511  }
512  m_DeviceView->CreateActionMenu(hMenu, true);
513  UpdateToolbar();
514  break;
515  }
516 
517  case NM_DBLCLK:
518  {
520  break;
521  }
522 
523  case NM_RCLICK:
524  {
525  Ret = m_DeviceView->OnRightClick(NmHdr);
526  break;
527  }
528 
529  case NM_RETURN:
530  {
532  break;
533  }
534 
535  case TTN_GETDISPINFO:
536  {
538  lpttt->hinst = g_hThisInstance;
539 
540  UINT_PTR idButton = lpttt->hdr.idFrom;
541  switch (idButton)
542  {
543  case IDM_PROPERTIES:
544  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_PROPERTIES);
545  break;
546  case IDM_SCAN_HARDWARE:
547  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SCAN);
548  break;
549  case IDM_ENABLE_DRV:
550  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_ENABLE);
551  break;
552  case IDM_DISABLE_DRV:
553  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_DISABLE);
554  break;
555  case IDM_UPDATE_DRV:
556  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE);
557  break;
558  case IDM_UNINSTALL_DRV:
559  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
560  break;
561  }
562  break;
563  }
564  }
565 
566  return Ret;
567 }
568 
569 LRESULT
571 {
573 }
574 
575 LRESULT
577  _In_ LPARAM /*lParam*/)
578 {
579  LRESULT RetCode = 0;
580  WORD Msg;
581 
582  // Get the message
583  Msg = LOWORD(wParam);
584 
585  switch (Msg)
586  {
587  case IDM_PROPERTIES:
588  case IDM_SCAN_HARDWARE:
589  case IDM_ENABLE_DRV:
590  case IDM_DISABLE_DRV:
591  case IDM_UPDATE_DRV:
592  case IDM_UNINSTALL_DRV:
593  case IDM_ADD_HARDWARE:
594  {
596  break;
597  }
598 
599  case IDM_ACTIONMENU:
600  {
601  // Create a popup menu with all the actions for the selected node
602  HMENU hMenu = CreatePopupMenu();
603  m_DeviceView->CreateActionMenu(hMenu, true);
604 
605  // Calculate where to put the menu
606  RECT rc;
608  LONG Height = rc.bottom - rc.top;
609 
610  // Display the menu
611  TrackPopupMenuEx(hMenu,
613  rc.left,
614  rc.top + Height,
615  m_hMainWnd,
616  NULL);
617 
618  DestroyMenu(hMenu);
619  break;
620  }
621 
622  case IDM_DEVBYTYPE:
623  {
624  RefreshView(DevicesByType, false);
625  break;
626  }
627 
628  case IDM_DEVBYCONN:
629  {
631  break;
632  }
633 
634  case IDM_SHOWHIDDEN:
635  {
636  // Get the current state
638  if (CurCheckState == MF_CHECKED)
639  {
642  }
643  else if (CurCheckState == MF_UNCHECKED)
644  {
647  }
648  // Refresh the device view
650  break;
651  }
652 
653  case IDM_ABOUT:
654  {
655  // Apportion blame
657  L"ReactOS Device Manager\r\nCopyright Ged Murphy 2015",
658  L"About",
659  MB_OK | MB_APPLMODAL);
660 
661  // Set focus back to the treeview
663  break;
664  }
665 
666  case IDM_EXIT:
667  {
668  // Post a close message to the window
670  WM_CLOSE,
671  0,
672  0);
673  break;
674  }
675 
676  default:
677  // We didn't handle it
678  RetCode = -1;
679  break;
680  }
681 
682  return RetCode;
683 }
684 
685 void
687 {
689 }
690 
691 LRESULT
693 {
694  // Uninitialize the device view
696 
697  // Kill the object
698  delete m_DeviceView;
699  m_DeviceView = NULL;
700 
701  // Clear the user data pointer
703 
704  // Break the message loop
705  PostQuitMessage(0);
706 
707  return 0;
708 }
709 
712  _In_ UINT msg,
715 {
717  LRESULT RetCode = 0;
718 
719  // Get the object pointer from window context
721  if (This == NULL)
722  {
723  // Check that this isn't a create message
724  if (msg != WM_CREATE)
725  {
726  // Don't handle null info pointer
727  goto HandleDefaultMessage;
728  }
729  }
730 
731  switch(msg)
732  {
733  case WM_CREATE:
734  {
735  // Get the object pointer from the create param
736  This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
737 
738  // Store the pointer in the window's global user data
740 
741  // Call the create handler
742  RetCode = This->OnCreate(hwnd);
743  break;
744  }
745 
746  case WM_SIZE:
747  {
748  RetCode = This->OnSize();
749  break;
750  }
751 
752  case WM_NOTIFY:
753  {
754  RetCode = This->OnNotify(lParam);
755  break;
756  }
757 
758  case WM_CONTEXTMENU:
759  {
760  RetCode = This->OnContext(lParam);
761  break;
762  }
763 
764  case WM_MENUSELECT:
765  {
766  if (This->m_hStatusBar != NULL)
767  {
768  if (!This->MainWndMenuHint(LOWORD(wParam),
770  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
772  {
773  This->MainWndMenuHint(LOWORD(wParam),
775  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
777  }
778  }
779 
780  break;
781  }
782 
783  case WM_COMMAND:
784  {
785  // Handle the command message
786  RetCode = This->OnCommand(wParam, lParam);
787  if (RetCode == -1)
788  {
789  // Hand it off to the default message handler
790  goto HandleDefaultMessage;
791  }
792  break;
793  }
794 
795  case WM_DEVICECHANGE:
796  {
798  {
799  //
800  // The OS can send multiple change messages in quick succession. To avoid
801  // refreshing multiple times (and to avoid waiting in the message thread)
802  // we set a timer to run in 500ms, which should leave enough time for all
803  // the messages to come through. Wrap so we don't set multiple timers
804  //
805  if (InterlockedCompareExchange((LONG *)&This->m_RefreshPending, TRUE, FALSE) == FALSE)
806  {
808  }
809  }
810  break;
811  }
812 
813  case WM_TIMER:
814  {
815  if (wParam == REFRESH_TIMER)
816  {
817  // Schedule a refresh (this just creates a thread and returns)
818  This->RefreshView(This->m_DeviceView->GetCurrentView(), true);
819 
820  // Cleanup the timer
822 
823  // Allow more change notifications
824  InterlockedExchange((LONG *)&This->m_RefreshPending, FALSE);
825  }
826  break;
827  }
828 
829  case WM_ENTERMENULOOP:
830  {
831  This->UpdateStatusBar(true);
832  break;
833  }
834 
835  case WM_EXITMENULOOP:
836  {
837  This->UpdateStatusBar(false);
838  break;
839  }
840 
841  case WM_CLOSE:
842  {
843  // Destroy the main window
845  break;
846  }
847 
848  case WM_ACTIVATE:
849  {
850  if (LOWORD(hwnd))
851  This->OnActivate();
852  break;
853  }
854 
855  case WM_DESTROY:
856  {
857  // Call the destroy handler
858  RetCode = This->OnDestroy();
859  break;
860  }
861 
862  default:
863  {
864 HandleDefaultMessage:
865  RetCode = DefWindowProc(hwnd, msg, wParam, lParam);
866  break;
867  }
868  }
869 
870  return RetCode;
871 }
#define IDS_TOOLTIP_UPDATE
Definition: resource.h:48
#define IDS_HINT_ADD
Definition: resource.h:73
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
LRESULT OnContext(_In_ LPARAM lParam)
Definition: MainWindow.cpp:570
#define IDS_HINT_EXIT
Definition: resource.h:96
#define IDS_HINT_BLANK
Definition: resource.h:94
bool Initialize(_In_z_ LPCTSTR lpCaption, _In_ int nCmdShow)
Definition: MainWindow.cpp:136
#define IDS_HINT_ABOUT
Definition: resource.h:117
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT OnCommand(_In_ WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:576
LRESULT OnNotify(_In_ LPARAM lParam)
Definition: MainWindow.cpp:498
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDM_UPDATE_DRV
Definition: resource.h:25
#define _In_opt_z_
Definition: no_sal2.h:221
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define IDS_TOOLTIP_DISABLE
Definition: resource.h:47
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
VOID SetFocus()
Definition: DeviceView.cpp:298
#define IDM_ACTIONMENU
Definition: resource.h:30
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_STATUSBAR
Definition: resource.h:14
#define MF_BYCOMMAND
Definition: winuser.h:202
#define SC_RESTORE
Definition: winuser.h:2573
UINT HintId
Definition: precomp.h:87
#define MB_APPLMODAL
Definition: winuser.h:786
Type
Definition: Type.h:6
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define IDM_ABOUT
Definition: resource.h:29
#define DBT_DEVNODES_CHANGED
Definition: dbt.h:28
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:985
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
#define IDM_DEVBYTYPE
Definition: resource.h:36
~CDeviceManager(void)
Definition: MainWindow.cpp:91
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TB_SETSTATE
Definition: commctrl.h:1026
VOID Refresh(_In_ ViewType Type, _In_ bool ScanForChanges, _In_ bool UpdateView)
Definition: DeviceView.cpp:195
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define _countof(array)
Definition: fontsub.cpp:30
static const MENU_HINT MainMenuHintTable[]
Definition: MainWindow.cpp:30
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IDS_TOOLTIP_PROPERTIES
Definition: resource.h:44
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
bool StatusBarLoadString(_In_ HWND hStatusBar, _In_ INT PartId, _In_ HINSTANCE hInstance, _In_ UINT uID)
Definition: MainWindow.cpp:411
#define CALLBACK
Definition: compat.h:27
bool CreateActionMenu(_In_ HMENU OwnerMenu, _In_ bool MainMenu)
Definition: DeviceView.cpp:304
LONG top
Definition: windef.h:292
#define InterlockedCompareExchange
Definition: interlocked.h:104
bool CreateStatusBar(void)
Definition: MainWindow.cpp:338
#define SM_CYSMICON
Definition: winuser.h:1003
HICON hIcon
Definition: winuser.h:3196
UINT_PTR WPARAM
Definition: windef.h:207
HINSTANCE hInst
Definition: commctrl.h:1031
#define WS_CHILD
Definition: pedump.c:617
struct _WNDCLASSEXW WNDCLASSEXW
void UpdateToolbar(void)
Definition: MainWindow.cpp:365
LONG left
Definition: windef.h:291
#define IDI_MAIN_ICON
Definition: resource.h:7
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT OnContextMenu(_In_ LPARAM lParam)
Definition: DeviceView.cpp:148
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
#define STATUSCLASSNAME
Definition: commctrl.h:1911
BOOL WINAPI DestroyWindow(_In_ HWND)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define BTN_DISABLE_DRV
Definition: MainWindow.cpp:20
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:123
struct tagNMHDR * LPNMHDR
#define IDS_HINT_ENABLE
Definition: resource.h:69
UINT code
Definition: winuser.h:3133
static const MENU_HINT SystemMenuHintTable[]
Definition: MainWindow.cpp:57
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
void UpdateStatusBar(_In_ bool InMenuLoop)
Definition: MainWindow.cpp:236
#define BTN_UPDATE_DRV
Definition: MainWindow.cpp:21
#define CCS_NODIVIDER
Definition: commctrl.h:2220
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HINSTANCE hInstance
Definition: charmap.c:20
#define BTNS_BUTTON
Definition: commctrl.h:970
LPCWSTR lpszMenuName
Definition: winuser.h:3199
LRESULT OnSize(void)
Definition: MainWindow.cpp:463
struct @1576 Msg[]
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
ViewType GetCurrentView()
Definition: DeviceView.h:74
#define IDM_UNINSTALL_DRV
Definition: resource.h:26
long LONG
Definition: pedump.c:60
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define WM_ENTERMENULOOP
Definition: winuser.h:1786
#define MF_BYPOSITION
Definition: winuser.h:203
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define WM_MENUSELECT
Definition: winuser.h:1729
#define IDM_RESBYTYPE
Definition: resource.h:38
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define SB_SIMPLEID
Definition: precomp.h:15
#define TTN_GETDISPINFO
Definition: commctrl.h:1850
#define SC_MAXIMIZE
Definition: winuser.h:2563
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWLP_USERDATA
Definition: treelist.c:63
#define IDM_DEVBYCONN
Definition: resource.h:37
#define SB_SIMPLE
Definition: commctrl.h:1930
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define WM_EXITMENULOOP
Definition: winuser.h:1787
smooth NULL
Definition: ftsmooth.c:416
#define IDS_HINT_SHOW_HIDDEN
Definition: resource.h:81
#define IDS_HINT_UNINSTALL
Definition: resource.h:72
CNode * GetSelectedNode()
Definition: DeviceView.cpp:320
void OnActivate(void)
Definition: MainWindow.cpp:686
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_TOOLTIP_SCAN
Definition: resource.h:45
return Found
Definition: dirsup.c:1270
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LPCWSTR lpszClassName
Definition: winuser.h:3200
Definition: Node.h:12
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define IDM_MAINMENU
Definition: resources.h:3
CStringT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT< wchar_t > > > CAtlStringW
Definition: atlstr.h:126
#define MF_CHECKED
Definition: winuser.h:132
VOID DisplayPropertySheet()
Definition: DeviceView.cpp:284
LRESULT OnAction(UINT Action)
Definition: DeviceView.cpp:222
#define LPTOOLTIPTEXT
Definition: commctrl.h:1862
#define IDS_HINT_SYS_MOVE
Definition: resource.h:121
#define IDM_RESBYCONN
Definition: resource.h:39
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define IDS_HINT_SCAN
Definition: resource.h:68
bool Initialize()
Definition: DeviceView.cpp:54
#define BTNS_SEP
Definition: commctrl.h:971
#define IDS_HINT_UPDATE
Definition: resource.h:71
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define SBARS_SIZEGRIP
Definition: commctrl.h:1895
#define WM_SIZE
Definition: winuser.h:1593
HBRUSH hbrBackground
Definition: winuser.h:3198
#define IDS_HINT_RES_BY_TYPE
Definition: resource.h:79
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
UINT cbSize
Definition: winuser.h:3190
#define TVN_SELCHANGED
Definition: commctrl.h:3707
#define WM_TIMER
Definition: winuser.h:1724
bool RefreshView(_In_ ViewType Type, _In_ bool ScanForChanges)
Definition: MainWindow.cpp:245
#define WM_CLOSE
Definition: winuser.h:1603
bool Uninitialize()
Definition: DeviceView.cpp:94
ViewType
Definition: DeviceView.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
int WINAPI GetSystemMetrics(_In_ int)
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_STATIC
Definition: resource.h:4
HWND hStatusBar
Definition: main.cpp:35
LRESULT OnSize(_In_ int x, _In_ int y, _In_ int cx, _In_ int cy)
Definition: DeviceView.cpp:108
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define IDC_TOOLBAR
Definition: wordpad.h:157
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:961
CDeviceView * m_DeviceView
Definition: MainWindow.h:13
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define IDM_ADD_HARDWARE
Definition: resource.h:27
#define TB_ADDBITMAP
Definition: commctrl.h:1028
HINSTANCE hInstance
Definition: winuser.h:3195
Definition: Node.h:9
#define BTN_PROPERTIES
Definition: MainWindow.cpp:17
#define SM_CXSMICON
Definition: winuser.h:1002
#define BTN_SCAN_HARDWARE
Definition: MainWindow.cpp:18
bool MainWndMenuHint(_In_ WORD CmdId, _In_ const MENU_HINT *HintArray, _In_ DWORD HintsCount, _In_ UINT DefHintId)
Definition: MainWindow.cpp:206
#define IDS_HINT_SYS_SIZE
Definition: resource.h:122
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
LRESULT OnCreate(_In_ HWND hwnd)
Definition: MainWindow.cpp:433
VOID SetHiddenDevices(_In_ bool ShowHidden)
Definition: DeviceView.h:69
#define IDS_HINT_DEV_BY_CONN
Definition: resource.h:78
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:119
bool CreateToolBar(void)
Definition: MainWindow.cpp:288
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define SB_SETTEXT
Definition: commctrl.h:1921
#define COLOR_BTNFACE
Definition: winuser.h:918
#define TB_ADDBUTTONSW
Definition: commctrl.h:1238
#define IDM_PROPERTIES
Definition: resources.h:9
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define false
Definition: stdbool.h:38
HCURSOR hCursor
Definition: winuser.h:3197
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define MF_UNCHECKED
Definition: winuser.h:204
#define LoadCursor
Definition: winuser.h:5713
#define InterlockedExchange
Definition: armddk.h:54
WNDPROC lpfnWndProc
Definition: winuser.h:3192
#define BTN_UNINSTALL_DRV
Definition: MainWindow.cpp:22
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define IDS_APPNAME
Definition: resource.h:49
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define SC_MINIMIZE
Definition: winuser.h:2561
#define _In_
Definition: no_sal2.h:204
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
HWND m_hStatusBar
Definition: MainWindow.h:15
#define NM_RETURN
Definition: commctrl.h:132
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define IDM_SCAN_HARDWARE
Definition: resource.h:22
#define IDS_HINT_DISABLE
Definition: resource.h:70
enum State_ State
Definition: pofuncs.h:54
HINSTANCE hInst
Definition: dxdiag.c:13
#define REFRESH_TIMER
Definition: MainWindow.cpp:24
#define WM_ACTIVATE
Definition: winuser.h:1594
#define NM_DBLCLK
Definition: commctrl.h:131
static TBBUTTON TbButtons[]
Definition: MainWindow.cpp:67
LRESULT OnDestroy(void)
Definition: MainWindow.cpp:692
#define IDM_DISABLE_DRV
Definition: resource.h:24
#define _In_z_
Definition: no_sal2.h:239
#define NM_RCLICK
Definition: commctrl.h:133
#define SC_SIZE
Definition: winuser.h:2559
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
CDeviceManager(void)
Definition: MainWindow.cpp:81
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:26
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:711
CAtlStringW m_szMainWndClass
Definition: MainWindow.h:12
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:124
#define IDM_EXIT
Definition: resource.h:27
#define SB_SETPARTS
Definition: commctrl.h:1926
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI GetMenuItemRect(_In_opt_ HWND, _In_ HMENU, _In_ UINT, _Out_ LPRECT)
#define WM_DEVICECHANGE
Definition: winuser.h:1793
HICON hIconSm
Definition: winuser.h:3201
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define SC_MOVE
Definition: winuser.h:2560
#define SC_CLOSE
Definition: winuser.h:2567
#define IDS_TOOLTIP_ENABLE
Definition: resource.h:46
#define IDM_SHOWHIDDEN
Definition: resource.h:40
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TBSTATE_HIDDEN
Definition: commctrl.h:947
#define SendMessage
Definition: winuser.h:5744
bool Create(_In_ HWND hWndParent, _In_ HINSTANCE hInst, _In_opt_z_ LPCWSTR lpMachineName, _In_ int nCmdShow)
Definition: MainWindow.cpp:96
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define WM_CREATE
Definition: winuser.h:1590
#define IDS_HINT_SYS_CLOSE
Definition: resource.h:125
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:962
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
LONG bottom
Definition: windef.h:294
#define IDB_TOOLBAR
Definition: wordpad.h:183
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define LoadImage
Definition: winuser.h:5716
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BTN_ENABLE_DRV
Definition: MainWindow.cpp:19
#define LoadIcon
Definition: winuser.h:5714
#define IDS_HINT_DEV_BY_TYPE
Definition: resource.h:77
#define GetWindowLongPtr
Definition: treelist.c:73
HINSTANCE g_hParentInstance
Definition: MainWindow.cpp:27
LONG_PTR LRESULT
Definition: windef.h:209
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
LRESULT OnRightClick(_In_ LPNMHDR NmHdr)
Definition: DeviceView.cpp:128
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define IDM_ENABLE_DRV
Definition: resource.h:23
#define TBSTYLE_FLAT
Definition: commctrl.h:964
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1162
#define IDS_HINT_PROPERTIES
Definition: resource.h:67
#define WM_NOTIFY
Definition: richedit.h:61
Definition: dlist.c:348
UINT_PTR nID
Definition: commctrl.h:1032
void Uninitialize(void)
Definition: MainWindow.cpp:184