ReactOS  0.4.12-dev-914-g71f84a3
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 
45  // View Menu
51 
53 
54 };
55 
56 
57 // system menu hints
59 {
66 };
67 
68 static TBBUTTON TbButtons[] =
69 {
72  { 2, IDC_STATIC, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 },
77 };
78 
79 
80 /* PUBLIC METHODS **********************************************/
81 
83  m_hMainWnd(NULL),
84  m_hStatusBar(NULL),
85  m_hToolBar(NULL),
86  m_CmdShow(0),
87  m_RefreshPending(false)
88 {
89  m_szMainWndClass = L"DevMgmtWndClass";
90 }
91 
93 {
94 }
95 
96 bool
99  _In_opt_z_ LPCWSTR /*lpMachineName*/,
100  _In_ int nCmdShow)
101 {
102  CDeviceManager MainWindow;
105  int Ret = 1;
106 
107  // Store the instances
109  g_hThisInstance = GetModuleHandleW(L"devmgr.dll");
110 
111  // Initialize common controls
112  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
114  InitCommonControlsEx(&icex);
115 
116  // Load the application name
117  if (szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
118  {
119  // Initialize the main window
120  if (MainWindow.Initialize(szAppName, nCmdShow))
121  {
122  // Run the application
123  Ret = MainWindow.Run();
124 
125  // Uninitialize the main window
126  MainWindow.Uninitialize();
127  }
128  }
129 
130  return (Ret == 0);
131 }
132 
133 
134 /* PRIVATE METHODS **********************************************/
135 
136 bool
138  _In_ int nCmdShow)
139 {
140  CAtlStringW szCaption;
141  WNDCLASSEXW wc = {0};
142 
143  // Store the show window value
144  m_CmdShow = nCmdShow;
145 
146  // Setup the window class struct
147  wc.cbSize = sizeof(WNDCLASSEXW);
152  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
157  IMAGE_ICON,
160  0);
161 
162  // Register the window
163  if (RegisterClassExW(&wc))
164  {
165  // Create the main window and store the object pointer
168  lpCaption,
172  550,
173  500,
174  NULL,
175  NULL,
177  this);
178  }
179 
180  // Return creation result
181  return !!(m_hMainWnd);
182 }
183 
184 void
186 {
187  // Unregister the window class
189 }
190 
191 int
193 {
194  MSG Msg;
195 
196  // Pump the message queue
197  while (GetMessageW(&Msg, NULL, 0, 0 ) != 0)
198  {
201  }
202 
203  return 0;
204 }
205 
206 bool
208  _In_ const MENU_HINT *HintArray,
209  _In_ DWORD HintsCount,
210  _In_ UINT DefHintId)
211 {
212  bool Found = false;
213  const MENU_HINT *LastHint;
214  UINT HintId = DefHintId;
215 
216  LastHint = HintArray + HintsCount;
217  while (HintArray != LastHint)
218  {
219  if (HintArray->CmdId == CmdId)
220  {
221  HintId = HintArray->HintId;
222  Found = true;
223  break;
224  }
225  HintArray++;
226  }
227 
229  SB_SIMPLEID,
231  HintId);
232 
233  return Found;
234 }
235 
236 void
238 {
240  SB_SIMPLE,
241  (WPARAM)InMenuLoop,
242  0);
243 }
244 
245 bool
247  _In_ bool ScanForChanges)
248 {
249  UINT CheckId = 0;
250 
251  // Refreshed the cached view
252  m_DeviceView->Refresh(Type, ScanForChanges, true);
253 
254  // Get the menu item id
255  switch (Type)
256  {
257  case DevicesByType:
258  CheckId = IDC_DEVBYTYPE;
259  break;
260 
261  case DevicesByConnection:
262  CheckId = IDC_DEVBYCONN;
263  break;
264 
265  case ResourcesByType:
266  CheckId = IDC_RESBYTYPE;
267  break;
268 
270  CheckId = IDC_RESBYCONN;
271  break;
272 
273  default:
274  ATLASSERT(FALSE);
275  break;
276  }
277 
278  // Set the new check item
282  CheckId,
283  MF_BYCOMMAND);
284 
285  return true;
286 }
287 
288 bool
290 {
291  TBADDBITMAP TbAddBitmap;
292 
295 
296  // Create the toolbar window
297  m_hToolBar = CreateWindowExW(dwExStyles,
299  NULL,
300  dwStyles,
301  0, 0, 0, 0,
302  m_hMainWnd,
305  NULL);
306  if (m_hToolBar == NULL)
307  return FALSE;
308 
309  // Don't show clipped buttons
312  0,
314 
316 
317  // Set the struct size, the toobar needs this...
320  sizeof(TBBUTTON),
321  0);
322 
323  TbAddBitmap.hInst = g_hThisInstance;
324  TbAddBitmap.nID = IDB_TOOLBAR;
326 
329 
330  if (TRUE)
331  {
333  }
334 
335  return TRUE;
336 }
337 
338 bool
340 {
341  int StatWidths[] = {110, -1}; // widths of status bar
342  bool bRet = FALSE;
343 
344  // Create the status bar
347  NULL,
349  0, 0, 0, 0,
350  m_hMainWnd,
353  NULL);
354  if (m_hStatusBar)
355  {
356  // Set the width
357  bRet = (SendMessageW(m_hStatusBar,
358  SB_SETPARTS,
359  sizeof(StatWidths) / sizeof(int),
360  (LPARAM)StatWidths) != 0);
361  }
362 
363  return bRet;
364 }
365 
367 {
368  WORD State;
369 
371 
372  // properties button
373  if (Node->HasProperties())
374  {
376  }
377  else
378  {
380  }
384 
385  // enable driver button
386  if (Node->GetNodeType() == DeviceNode &&
387  dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
388  {
390  }
391  else
392  {
394  }
396 
397  // disable driver button
398  if (Node->GetNodeType() == DeviceNode &&
399  dynamic_cast<CDeviceNode *>(Node)->CanDisable() &&
400  !dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
401  {
403  }
404  else
405  {
407  }
409 }
410 
411 bool
413  _In_ INT PartId,
415  _In_ UINT uID)
416 {
417  CAtlStringW szMessage;
418  bool bRet = false;
419 
420  // Load the string
421  if (szMessage.LoadStringW(hInstance, uID))
422  {
423  // Show the string on the status bar
424  bRet = (SendMessageW(hStatusBar,
425  SB_SETTEXT,
426  (WPARAM)PartId,
427  (LPARAM)szMessage.GetBuffer()) != 0);
428  }
429 
430  return bRet;
431 }
432 
433 LRESULT
435 {
436  LRESULT RetCode;
437 
438  RetCode = -1;
439  m_hMainWnd = hwnd;
440 
441  // Store a handle to the main menu
443 
444  // Create the toolbar and statusbar
445  if (CreateToolBar() && CreateStatusBar())
446  {
447  // Create the device view object
449  if (m_DeviceView->Initialize())
450  {
451  // Do the initial scan
453 
454  // Display the window according to the user request
456  RetCode = 0;
457  }
458  }
459 
460  return RetCode;
461 }
462 
463 LRESULT
465 {
466  RECT rcClient, rcTool, rcStatus;
467  INT lvHeight, iToolHeight, iStatusHeight;
468 
469  // Autosize the toolbar
471 
472  // Get the toolbar rect and save the height
473  GetWindowRect(m_hToolBar, &rcTool);
474  iToolHeight = rcTool.bottom - rcTool.top;
475 
476  // Resize the status bar
478 
479  // Get the statusbar rect and save the height
480  GetWindowRect(m_hStatusBar, &rcStatus);
481  iStatusHeight = rcStatus.bottom - rcStatus.top;
482 
483  // Get the full client rect
484  GetClientRect(m_hMainWnd, &rcClient);
485 
486  // Calculate the remaining height for the treeview
487  lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
488 
489  // Resize the device view
490  m_DeviceView->OnSize(0,
491  iToolHeight,
492  rcClient.right,
493  lvHeight);
494 
495  return 0;
496 }
497 
498 LRESULT
500 {
501  LPNMHDR NmHdr = (LPNMHDR)lParam;
502  LRESULT Ret = 0;
503 
504  switch (NmHdr->code)
505  {
506  case TVN_SELCHANGED:
507  {
508  UpdateToolbar();
509  break;
510  }
511 
512  case NM_DBLCLK:
513  {
515  break;
516  }
517 
518  case NM_RCLICK:
519  {
520  Ret = m_DeviceView->OnRightClick(NmHdr);
521  break;
522  }
523 
524  case NM_RETURN:
525  {
527  break;
528  }
529 
530  case TTN_GETDISPINFO:
531  {
533  lpttt->hinst = g_hThisInstance;
534 
535  UINT_PTR idButton = lpttt->hdr.idFrom;
536  switch (idButton)
537  {
538  case IDC_PROPERTIES:
539  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_PROPERTIES);
540  break;
541  case IDC_SCAN_HARDWARE:
542  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SCAN);
543  break;
544  case IDC_ENABLE_DRV:
545  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_ENABLE);
546  break;
547  case IDC_DISABLE_DRV:
548  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_DISABLE);
549  break;
550  case IDC_UPDATE_DRV:
551  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE);
552  break;
553  case IDC_UNINSTALL_DRV:
554  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
555  break;
556  }
557  break;
558  }
559  }
560 
561  return Ret;
562 }
563 
564 LRESULT
566 {
568 }
569 
570 LRESULT
572  _In_ LPARAM /*lParam*/)
573 {
574  LRESULT RetCode = 0;
575  WORD Msg;
576 
577  // Get the message
578  Msg = LOWORD(wParam);
579 
580  switch (Msg)
581  {
582  case IDC_PROPERTIES:
583  case IDC_SCAN_HARDWARE:
584  case IDC_ENABLE_DRV:
585  case IDC_DISABLE_DRV:
586  case IDC_UPDATE_DRV:
587  case IDC_UNINSTALL_DRV:
588  case IDC_ADD_HARDWARE:
589  {
591  break;
592  }
593 
594  case IDC_ACTIONMENU:
595  {
596  // Create a popup menu with all the actions for the selected node
597  HMENU hMenu = CreatePopupMenu();
598  m_DeviceView->CreateActionMenu(hMenu, true);
599 
600  // Calculate where to put the menu
601  RECT rc;
603  LONG Height = rc.bottom - rc.top;
604 
605  // Display the menu
606  TrackPopupMenuEx(hMenu,
608  rc.left,
609  rc.top + Height,
610  m_hMainWnd,
611  NULL);
612 
613  DestroyMenu(hMenu);
614  break;
615  }
616 
617  case IDC_DEVBYTYPE:
618  {
619  RefreshView(DevicesByType, false);
620  break;
621  }
622 
623  case IDC_DEVBYCONN:
624  {
626  break;
627  }
628 
629  case IDC_SHOWHIDDEN:
630  {
631  // Get the current state
633  if (CurCheckState == MF_CHECKED)
634  {
637  }
638  else if (CurCheckState == MF_UNCHECKED)
639  {
642  }
643  // Refresh the device view
645  break;
646  }
647 
648  case IDC_ABOUT:
649  {
650  // Apportion blame
652  L"ReactOS Device Manager\r\nCopyright Ged Murphy 2015",
653  L"About",
654  MB_OK | MB_APPLMODAL);
655 
656  // Set focus back to the treeview
658  break;
659  }
660 
661  case IDC_EXIT:
662  {
663  // Post a close message to the window
665  WM_CLOSE,
666  0,
667  0);
668  break;
669  }
670 
671  default:
672  // We didn't handle it
673  RetCode = -1;
674  break;
675  }
676 
677  return RetCode;
678 }
679 
680 void
682 {
684 }
685 
686 LRESULT
688 {
689  // Uninitialize the device view
691 
692  // Kill the object
693  delete m_DeviceView;
694  m_DeviceView = NULL;
695 
696  // Clear the user data pointer
698 
699  // Break the message loop
700  PostQuitMessage(0);
701 
702  return 0;
703 }
704 
707  _In_ UINT msg,
710 {
712  LRESULT RetCode = 0;
713 
714  // Get the object pointer from window context
716  if (This == NULL)
717  {
718  // Check that this isn't a create message
719  if (msg != WM_CREATE)
720  {
721  // Don't handle null info pointer
722  goto HandleDefaultMessage;
723  }
724  }
725 
726  switch(msg)
727  {
728  case WM_CREATE:
729  {
730  // Get the object pointer from the create param
731  This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
732 
733  // Store the pointer in the window's global user data
735 
736  // Call the create handler
737  RetCode = This->OnCreate(hwnd);
738  break;
739  }
740 
741  case WM_SIZE:
742  {
743  RetCode = This->OnSize();
744  break;
745  }
746 
747  case WM_NOTIFY:
748  {
749  RetCode = This->OnNotify(lParam);
750  break;
751  }
752 
753  case WM_CONTEXTMENU:
754  {
755  RetCode = This->OnContext(lParam);
756  break;
757  }
758 
759  case WM_MENUSELECT:
760  {
761  if (This->m_hStatusBar != NULL)
762  {
763  if (!This->MainWndMenuHint(LOWORD(wParam),
765  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
767  {
768  This->MainWndMenuHint(LOWORD(wParam),
770  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
772  }
773  }
774 
775  break;
776  }
777 
778  case WM_COMMAND:
779  {
780  // Handle the command message
781  RetCode = This->OnCommand(wParam, lParam);
782  if (RetCode == -1)
783  {
784  // Hand it off to the default message handler
785  goto HandleDefaultMessage;
786  }
787  break;
788  }
789 
790  case WM_DEVICECHANGE:
791  {
793  {
794  //
795  // The OS can send multiple change messages in quick succession. To avoid
796  // refreshing multiple times (and to avoid waiting in the message thread)
797  // we set a timer to run in 500ms, which should leave enough time for all
798  // the messages to come through. Wrap so we don't set multiple timers
799  //
800  if (InterlockedCompareExchange((LONG *)&This->m_RefreshPending, TRUE, FALSE) == FALSE)
801  {
803  }
804  }
805  break;
806  }
807 
808  case WM_TIMER:
809  {
810  if (wParam == REFRESH_TIMER)
811  {
812  // Schedule a refresh (this just creates a thread and returns)
813  This->RefreshView(This->m_DeviceView->GetCurrentView(), true);
814 
815  // Cleanup the timer
817 
818  // Allow more change notifications
819  InterlockedExchange((LONG *)&This->m_RefreshPending, FALSE);
820  }
821  break;
822  }
823 
824  case WM_ENTERMENULOOP:
825  {
826  This->UpdateStatusBar(true);
827  break;
828  }
829 
830  case WM_EXITMENULOOP:
831  {
832  This->UpdateStatusBar(false);
833  break;
834  }
835 
836  case WM_CLOSE:
837  {
838  // Destroy the main window
840  break;
841  }
842 
843  case WM_ACTIVATE:
844  {
845  if (LOWORD(hwnd))
846  This->OnActivate();
847  break;
848  }
849 
850  case WM_DESTROY:
851  {
852  // Call the destroy handler
853  RetCode = This->OnDestroy();
854  break;
855  }
856 
857  default:
858  {
859 HandleDefaultMessage:
860  RetCode = DefWindowProc(hwnd, msg, wParam, lParam);
861  break;
862  }
863  }
864 
865  return RetCode;
866 }
#define IDS_TOOLTIP_UPDATE
Definition: resource.h:46
#define IDS_HINT_ADD
Definition: resource.h:71
#define IDC_DEVBYCONN
Definition: resource.h:35
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
LRESULT OnContext(_In_ LPARAM lParam)
Definition: MainWindow.cpp:565
#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:137
#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:571
LRESULT OnNotify(_In_ LPARAM lParam)
Definition: MainWindow.cpp:499
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDR_MAINMENU
Definition: resource.h:40
#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:45
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define IDC_ENABLE_DRV
Definition: resource.h:21
VOID SetFocus()
Definition: DeviceView.cpp:298
#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:2552
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 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
~CDeviceManager(void)
Definition: MainWindow.cpp:92
#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:42
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
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:412
#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:339
#define SM_CYSMICON
Definition: winuser.h:1003
HICON hIcon
Definition: winuser.h:3175
struct @1567 Msg[]
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:366
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:67
UINT code
Definition: winuser.h:3112
static const MENU_HINT SystemMenuHintTable[]
Definition: MainWindow.cpp:58
#define IDC_DEVBYTYPE
Definition: resource.h:34
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define IDC_ACTIONMENU
Definition: resource.h:28
void UpdateStatusBar(_In_ bool InMenuLoop)
Definition: MainWindow.cpp:237
#define BTN_UPDATE_DRV
Definition: MainWindow.cpp:21
#define CCS_NODIVIDER
Definition: commctrl.h:2220
#define TPM_RIGHTBUTTON
Definition: winuser.h:2334
HINSTANCE hInstance
Definition: charmap.c:20
#define BTNS_BUTTON
Definition: commctrl.h:970
LPCWSTR lpszMenuName
Definition: winuser.h:3178
LRESULT OnSize(void)
Definition: MainWindow.cpp:464
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define IDC_UNINSTALL_DRV
Definition: resource.h:24
ViewType GetCurrentView()
Definition: DeviceView.h:74
long LONG
Definition: pedump.c:60
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define IDC_RESBYTYPE
Definition: resource.h:36
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define WM_MENUSELECT
Definition: winuser.h:1723
#define SB_SIMPLEID
Definition: precomp.h:15
#define TTN_GETDISPINFO
Definition: commctrl.h:1850
#define SC_MAXIMIZE
Definition: winuser.h:2542
#define CW_USEDEFAULT
Definition: winuser.h:225
#define IDC_EXIT
Definition: resource.h:30
#define GWLP_USERDATA
Definition: treelist.c:63
#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:1781
smooth NULL
Definition: ftsmooth.c:416
#define IDS_HINT_SHOW_HIDDEN
Definition: resource.h:79
#define IDS_HINT_UNINSTALL
Definition: resource.h:70
CNode * GetSelectedNode()
Definition: DeviceView.cpp:320
void OnActivate(void)
Definition: MainWindow.cpp:681
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_TOOLTIP_SCAN
Definition: resource.h:43
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:3179
Definition: Node.h:12
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
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 ICC_BAR_CLASSES
Definition: commctrl.h:60
#define IDS_HINT_SCAN
Definition: resource.h:66
bool Initialize()
Definition: DeviceView.cpp:54
#define BTNS_SEP
Definition: commctrl.h:971
#define IDS_HINT_UPDATE
Definition: resource.h:69
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:3177
#define IDS_HINT_RES_BY_TYPE
Definition: resource.h:77
UINT cbSize
Definition: winuser.h:3169
#define TVN_SELCHANGED
Definition: commctrl.h:3707
#define WM_TIMER
Definition: winuser.h:1718
bool RefreshView(_In_ ViewType Type, _In_ bool ScanForChanges)
Definition: MainWindow.cpp:246
#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
#define IDC_PROPERTIES
Definition: resource.h:32
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 false
Definition: stdbool.h:38
#define TB_ADDBITMAP
Definition: commctrl.h:1028
HINSTANCE hInstance
Definition: winuser.h:3174
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:207
#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:434
VOID SetHiddenDevices(_In_ bool ShowHidden)
Definition: DeviceView.h:69
#define IDS_HINT_DEV_BY_CONN
Definition: resource.h:76
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:118
bool CreateToolBar(void)
Definition: MainWindow.cpp:289
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 TB_SETBITMAPSIZE
Definition: commctrl.h:1108
HCURSOR hCursor
Definition: winuser.h:3176
#define WM_COMMAND
Definition: winuser.h:1716
#define MF_UNCHECKED
Definition: winuser.h:204
#define LoadCursor
Definition: winuser.h:5678
#define InterlockedExchange
Definition: armddk.h:54
WNDPROC lpfnWndProc
Definition: winuser.h:3171
#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:2540
#define IDC_SHOWHIDDEN
Definition: resource.h:38
#define _In_
Definition: no_sal2.h:204
#define IDC_SCAN_HARDWARE
Definition: resource.h:20
#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 IDS_HINT_DISABLE
Definition: resource.h:68
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:68
#define IDC_DISABLE_DRV
Definition: resource.h:22
#define IDC_UPDATE_DRV
Definition: resource.h:23
LRESULT OnDestroy(void)
Definition: MainWindow.cpp:687
#define _In_z_
Definition: no_sal2.h:239
#define NM_RCLICK
Definition: commctrl.h:133
#define SC_SIZE
Definition: winuser.h:2538
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
CDeviceManager(void)
Definition: MainWindow.cpp:82
__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:706
CAtlStringW m_szMainWndClass
Definition: MainWindow.h:12
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:124
#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:1787
HICON hIconSm
Definition: winuser.h:3180
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define IDC_ADD_HARDWARE
Definition: resource.h:25
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define SC_MOVE
Definition: winuser.h:2539
#define SC_CLOSE
Definition: winuser.h:2546
#define IDS_TOOLTIP_ENABLE
Definition: resource.h:44
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TBSTATE_HIDDEN
Definition: commctrl.h:947
#define SendMessage
Definition: winuser.h:5709
bool Create(_In_ HWND hWndParent, _In_ HINSTANCE hInst, _In_opt_z_ LPCWSTR lpMachineName, _In_ int nCmdShow)
Definition: MainWindow.cpp:97
#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:845
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:5681
#define IDC_RESBYCONN
Definition: resource.h:37
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BTN_ENABLE_DRV
Definition: MainWindow.cpp:19
#define LoadIcon
Definition: winuser.h:5679
#define IDS_HINT_DEV_BY_TYPE
Definition: resource.h:75
#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
#define IDC_ABOUT
Definition: resource.h:29
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 TBSTYLE_FLAT
Definition: commctrl.h:964
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1162
#define IDS_HINT_PROPERTIES
Definition: resource.h:65
#define WM_NOTIFY
Definition: richedit.h:61
Definition: dlist.c:348
UINT_PTR nID
Definition: commctrl.h:1032
void Uninitialize(void)
Definition: MainWindow.cpp:185