ReactOS  0.4.15-dev-489-g75a0787
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 /* DATA *****************************************************/
15 
16 #define BTN_PROPERTIES 0
17 #define BTN_SCAN_HARDWARE 1
18 #define BTN_ENABLE_DRV 2
19 #define BTN_DISABLE_DRV 3
20 #define BTN_UPDATE_DRV 4
21 #define BTN_UNINSTALL_DRV 5
22 
23 #define REFRESH_TIMER 1
24 
27 
28 // menu hints
29 static const MENU_HINT MainMenuHintTable[] =
30 {
31  // File Menu
33 
34  // Action Menu
42 
43  // View Menu
49 
51 
52 };
53 
54 
55 // system menu hints
57 {
64 };
65 
66 static TBBUTTON TbButtons[] =
67 {
70  { 2, IDC_STATIC, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 },
75 };
76 
77 
78 /* PUBLIC METHODS **********************************************/
79 
81  m_hMainWnd(NULL),
82  m_hStatusBar(NULL),
83  m_hToolBar(NULL),
84  m_CmdShow(0),
85  m_RefreshPending(false)
86 {
87  m_szMainWndClass = L"DevMgmtWndClass";
88 }
89 
91 {
92 }
93 
94 bool
97  _In_opt_z_ LPCWSTR /*lpMachineName*/,
98  _In_ int nCmdShow)
99 {
100  CDeviceManager MainWindow;
103  int Ret = 1;
104 
105  // Store the instances
107  g_hThisInstance = GetModuleHandleW(L"devmgr.dll");
108 
109  // Initialize common controls
110  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
112  InitCommonControlsEx(&icex);
113 
114  // Load the application name
115  if (szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
116  {
117  // Initialize the main window
118  if (MainWindow.Initialize(szAppName, nCmdShow))
119  {
120  // Run the application
121  Ret = MainWindow.Run();
122 
123  // Uninitialize the main window
124  MainWindow.Uninitialize();
125  }
126  }
127 
128  return (Ret == 0);
129 }
130 
131 
132 /* PRIVATE METHODS **********************************************/
133 
134 bool
136  _In_ int nCmdShow)
137 {
138  CAtlStringW szCaption;
139  WNDCLASSEXW wc = {0};
140 
141  // Store the show window value
142  m_CmdShow = nCmdShow;
143 
144  // Setup the window class struct
145  wc.cbSize = sizeof(WNDCLASSEXW);
150  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
155  IMAGE_ICON,
158  0);
159 
160  // Register the window
161  if (RegisterClassExW(&wc))
162  {
163  // Create the main window and store the object pointer
166  lpCaption,
170  550,
171  500,
172  NULL,
173  NULL,
175  this);
176  }
177 
178  // Return creation result
179  return !!(m_hMainWnd);
180 }
181 
182 void
184 {
185  // Unregister the window class
187 }
188 
189 int
191 {
192  MSG Msg;
193 
194  // Pump the message queue
195  while (GetMessageW(&Msg, NULL, 0, 0 ) != 0)
196  {
199  }
200 
201  return 0;
202 }
203 
204 bool
206  _In_ const MENU_HINT *HintArray,
207  _In_ DWORD HintsCount,
208  _In_ UINT DefHintId)
209 {
210  bool Found = false;
211  const MENU_HINT *LastHint;
212  UINT HintId = DefHintId;
213 
214  LastHint = HintArray + HintsCount;
215  while (HintArray != LastHint)
216  {
217  if (HintArray->CmdId == CmdId)
218  {
219  HintId = HintArray->HintId;
220  Found = true;
221  break;
222  }
223  HintArray++;
224  }
225 
227  SB_SIMPLEID,
229  HintId);
230 
231  return Found;
232 }
233 
234 void
236 {
238  SB_SIMPLE,
239  (WPARAM)InMenuLoop,
240  0);
241 }
242 
243 bool
245  _In_ bool ScanForChanges)
246 {
247  UINT CheckId = 0;
248 
249  // Refreshed the cached view
250  m_DeviceView->Refresh(Type, ScanForChanges, true);
251 
252  // Get the menu item id
253  switch (Type)
254  {
255  case DevicesByType:
256  CheckId = IDM_DEVBYTYPE;
257  break;
258 
259  case DevicesByConnection:
260  CheckId = IDM_DEVBYCONN;
261  break;
262 
263  case ResourcesByType:
264  CheckId = IDM_RESBYTYPE;
265  break;
266 
268  CheckId = IDM_RESBYCONN;
269  break;
270 
271  default:
272  ATLASSERT(FALSE);
273  break;
274  }
275 
276  // Set the new check item
280  CheckId,
281  MF_BYCOMMAND);
282 
283  return true;
284 }
285 
286 bool
288 {
289  TBADDBITMAP TbAddBitmap;
290 
293 
294  // Create the toolbar window
295  m_hToolBar = CreateWindowExW(dwExStyles,
297  NULL,
298  dwStyles,
299  0, 0, 0, 0,
300  m_hMainWnd,
303  NULL);
304  if (m_hToolBar == NULL)
305  return FALSE;
306 
307  // Don't show clipped buttons
310  0,
312 
314 
315  // Set the struct size, the toobar needs this...
318  sizeof(TBBUTTON),
319  0);
320 
321  TbAddBitmap.hInst = g_hThisInstance;
322  TbAddBitmap.nID = IDB_TOOLBAR;
324 
327 
328  if (TRUE)
329  {
331  }
332 
333  return TRUE;
334 }
335 
336 bool
338 {
339  int StatWidths[] = {110, -1}; // widths of status bar
340  bool bRet = FALSE;
341 
342  // Create the status bar
345  NULL,
347  0, 0, 0, 0,
348  m_hMainWnd,
351  NULL);
352  if (m_hStatusBar)
353  {
354  // Set the width
355  bRet = (SendMessageW(m_hStatusBar,
356  SB_SETPARTS,
357  sizeof(StatWidths) / sizeof(int),
358  (LPARAM)StatWidths) != 0);
359  }
360 
361  return bRet;
362 }
363 
365 {
366  WORD State;
367 
369 
370  // properties button
371  if (Node->HasProperties())
372  {
374  }
375  else
376  {
378  }
382 
383  // enable driver button
384  if (Node->GetNodeType() == DeviceNode &&
385  dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
386  {
388  }
389  else
390  {
392  }
394 
395  // disable driver button
396  if (Node->GetNodeType() == DeviceNode &&
397  dynamic_cast<CDeviceNode *>(Node)->CanDisable() &&
398  !dynamic_cast<CDeviceNode *>(Node)->IsDisabled())
399  {
401  }
402  else
403  {
405  }
407 }
408 
409 bool
411  _In_ INT PartId,
413  _In_ UINT uID)
414 {
415  CAtlStringW szMessage;
416  bool bRet = false;
417 
418  // Load the string
419  if (szMessage.LoadStringW(hInstance, uID))
420  {
421  // Show the string on the status bar
422  bRet = (SendMessageW(hStatusBar,
423  SB_SETTEXT,
424  (WPARAM)PartId,
425  (LPARAM)szMessage.GetBuffer()) != 0);
426  }
427 
428  return bRet;
429 }
430 
431 LRESULT
433 {
434  LRESULT RetCode;
435 
436  RetCode = -1;
437  m_hMainWnd = hwnd;
438 
439  // Store a handle to the main menu
441 
442  // Create the toolbar and statusbar
443  if (CreateToolBar() && CreateStatusBar())
444  {
445  // Create the device view object
447  if (m_DeviceView->Initialize())
448  {
449  // Do the initial scan
451 
452  // Display the window according to the user request
454  RetCode = 0;
455  }
456  }
457 
458  return RetCode;
459 }
460 
461 LRESULT
463 {
464  RECT rcClient, rcTool, rcStatus;
465  INT lvHeight, iToolHeight, iStatusHeight;
466 
467  // Autosize the toolbar
469 
470  // Get the toolbar rect and save the height
471  GetWindowRect(m_hToolBar, &rcTool);
472  iToolHeight = rcTool.bottom - rcTool.top;
473 
474  // Resize the status bar
476 
477  // Get the statusbar rect and save the height
478  GetWindowRect(m_hStatusBar, &rcStatus);
479  iStatusHeight = rcStatus.bottom - rcStatus.top;
480 
481  // Get the full client rect
482  GetClientRect(m_hMainWnd, &rcClient);
483 
484  // Calculate the remaining height for the treeview
485  lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
486 
487  // Resize the device view
488  m_DeviceView->OnSize(0,
489  iToolHeight,
490  rcClient.right,
491  lvHeight);
492 
493  return 0;
494 }
495 
496 LRESULT
498 {
499  LPNMHDR NmHdr = (LPNMHDR)lParam;
500  LRESULT Ret = 0;
501 
502  switch (NmHdr->code)
503  {
504  case TVN_SELCHANGED:
505  {
506  HMENU hMenu = GetSubMenu(m_hMenu, 1);
507  for (INT i = GetMenuItemCount(hMenu) - 1; i >= 0; i--)
508  {
509  DeleteMenu(hMenu, i, MF_BYPOSITION);
510  }
511  m_DeviceView->CreateActionMenu(hMenu, true);
512  UpdateToolbar();
513  break;
514  }
515 
516  case NM_DBLCLK:
517  {
519  break;
520  }
521 
522  case NM_RCLICK:
523  {
524  Ret = m_DeviceView->OnRightClick(NmHdr);
525  break;
526  }
527 
528  case NM_RETURN:
529  {
531  break;
532  }
533 
534  case TTN_GETDISPINFO:
535  {
537  lpttt->hinst = g_hThisInstance;
538 
539  UINT_PTR idButton = lpttt->hdr.idFrom;
540  switch (idButton)
541  {
542  case IDM_PROPERTIES:
543  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_PROPERTIES);
544  break;
545  case IDM_SCAN_HARDWARE:
546  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SCAN);
547  break;
548  case IDM_ENABLE_DRV:
549  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_ENABLE);
550  break;
551  case IDM_DISABLE_DRV:
552  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_DISABLE);
553  break;
554  case IDM_UPDATE_DRV:
555  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE);
556  break;
557  case IDM_UNINSTALL_DRV:
558  lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
559  break;
560  }
561  break;
562  }
563  }
564 
565  return Ret;
566 }
567 
568 LRESULT
570 {
572 }
573 
574 LRESULT
576  _In_ LPARAM /*lParam*/)
577 {
578  LRESULT RetCode = 0;
579  WORD Msg;
580 
581  // Get the message
582  Msg = LOWORD(wParam);
583 
584  switch (Msg)
585  {
586  case IDM_PROPERTIES:
587  case IDM_SCAN_HARDWARE:
588  case IDM_ENABLE_DRV:
589  case IDM_DISABLE_DRV:
590  case IDM_UPDATE_DRV:
591  case IDM_UNINSTALL_DRV:
592  case IDM_ADD_HARDWARE:
593  {
595  break;
596  }
597 
598  case IDM_ACTIONMENU:
599  {
600  // Create a popup menu with all the actions for the selected node
601  HMENU hMenu = CreatePopupMenu();
602  m_DeviceView->CreateActionMenu(hMenu, true);
603 
604  // Calculate where to put the menu
605  RECT rc;
607  LONG Height = rc.bottom - rc.top;
608 
609  // Display the menu
610  TrackPopupMenuEx(hMenu,
612  rc.left,
613  rc.top + Height,
614  m_hMainWnd,
615  NULL);
616 
617  DestroyMenu(hMenu);
618  break;
619  }
620 
621  case IDM_DEVBYTYPE:
622  {
623  RefreshView(DevicesByType, false);
624  break;
625  }
626 
627  case IDM_DEVBYCONN:
628  {
630  break;
631  }
632 
633  case IDM_SHOWHIDDEN:
634  {
635  // Get the current state
637  if (CurCheckState == MF_CHECKED)
638  {
641  }
642  else if (CurCheckState == MF_UNCHECKED)
643  {
646  }
647  // Refresh the device view
649  break;
650  }
651 
652  case IDM_ABOUT:
653  {
655  CAtlStringW szAppAuthors;
656  HICON hIcon;
657 
658  if (!szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
659  szAppName = L"ReactOS Device Manager";
660  if (!szAppAuthors.LoadStringW(g_hThisInstance, IDS_APP_AUTHORS))
661  szAppAuthors = L"";
663  ShellAboutW(m_hMainWnd, szAppName, szAppAuthors, hIcon);
664  if (hIcon)
666 
667  // Set focus back to the treeview
669  break;
670  }
671 
672  case IDM_EXIT:
673  {
674  // Post a close message to the window
676  WM_CLOSE,
677  0,
678  0);
679  break;
680  }
681 
682  default:
683  // We didn't handle it
684  RetCode = -1;
685  break;
686  }
687 
688  return RetCode;
689 }
690 
691 void
693 {
695 }
696 
697 LRESULT
699 {
700  // Uninitialize the device view
702 
703  // Kill the object
704  delete m_DeviceView;
705  m_DeviceView = NULL;
706 
707  // Clear the user data pointer
709 
710  // Break the message loop
711  PostQuitMessage(0);
712 
713  return 0;
714 }
715 
718  _In_ UINT msg,
721 {
723  LRESULT RetCode = 0;
724 
725  // Get the object pointer from window context
727  if (This == NULL)
728  {
729  // Check that this isn't a create message
730  if (msg != WM_CREATE)
731  {
732  // Don't handle null info pointer
733  goto HandleDefaultMessage;
734  }
735  }
736 
737  switch(msg)
738  {
739  case WM_CREATE:
740  {
741  // Get the object pointer from the create param
742  This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
743 
744  // Store the pointer in the window's global user data
746 
747  // Call the create handler
748  RetCode = This->OnCreate(hwnd);
749  break;
750  }
751 
752  case WM_SIZE:
753  {
754  RetCode = This->OnSize();
755  break;
756  }
757 
758  case WM_NOTIFY:
759  {
760  RetCode = This->OnNotify(lParam);
761  break;
762  }
763 
764  case WM_CONTEXTMENU:
765  {
766  RetCode = This->OnContext(lParam);
767  break;
768  }
769 
770  case WM_MENUSELECT:
771  {
772  if (This->m_hStatusBar != NULL)
773  {
774  if (!This->MainWndMenuHint(LOWORD(wParam),
776  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
778  {
779  This->MainWndMenuHint(LOWORD(wParam),
781  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
783  }
784  }
785 
786  break;
787  }
788 
789  case WM_COMMAND:
790  {
791  // Handle the command message
792  RetCode = This->OnCommand(wParam, lParam);
793  if (RetCode == -1)
794  {
795  // Hand it off to the default message handler
796  goto HandleDefaultMessage;
797  }
798  break;
799  }
800 
801  case WM_DEVICECHANGE:
802  {
804  {
805  //
806  // The OS can send multiple change messages in quick succession. To avoid
807  // refreshing multiple times (and to avoid waiting in the message thread)
808  // we set a timer to run in 500ms, which should leave enough time for all
809  // the messages to come through. Wrap so we don't set multiple timers
810  //
811  if (InterlockedCompareExchange((LONG *)&This->m_RefreshPending, TRUE, FALSE) == FALSE)
812  {
814  }
815  }
816  break;
817  }
818 
819  case WM_TIMER:
820  {
821  if (wParam == REFRESH_TIMER)
822  {
823  // Schedule a refresh (this just creates a thread and returns)
824  This->RefreshView(This->m_DeviceView->GetCurrentView(), true);
825 
826  // Cleanup the timer
828 
829  // Allow more change notifications
830  InterlockedExchange((LONG *)&This->m_RefreshPending, FALSE);
831  }
832  break;
833  }
834 
835  case WM_ENTERMENULOOP:
836  {
837  This->UpdateStatusBar(true);
838  break;
839  }
840 
841  case WM_EXITMENULOOP:
842  {
843  This->UpdateStatusBar(false);
844  break;
845  }
846 
847  case WM_CLOSE:
848  {
849  // Destroy the main window
851  break;
852  }
853 
854  case WM_ACTIVATE:
855  {
856  if (LOWORD(hwnd))
857  This->OnActivate();
858  break;
859  }
860 
861  case WM_DESTROY:
862  {
863  // Call the destroy handler
864  RetCode = This->OnDestroy();
865  break;
866  }
867 
868  default:
869  {
870 HandleDefaultMessage:
871  RetCode = DefWindowProc(hwnd, msg, wParam, lParam);
872  break;
873  }
874  }
875 
876  return RetCode;
877 }
#define IDS_TOOLTIP_UPDATE
Definition: resource.h:49
#define IDS_HINT_ADD
Definition: resource.h:74
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
LRESULT OnContext(_In_ LPARAM lParam)
Definition: MainWindow.cpp:569
#define IDS_HINT_EXIT
Definition: resource.h:94
#define IDS_HINT_BLANK
Definition: resource.h:92
bool Initialize(_In_z_ LPCTSTR lpCaption, _In_ int nCmdShow)
Definition: MainWindow.cpp:135
#define IDS_HINT_ABOUT
Definition: resource.h:115
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT OnCommand(_In_ WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:575
LRESULT OnNotify(_In_ LPARAM lParam)
Definition: MainWindow.cpp:497
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDM_UPDATE_DRV
Definition: resource.h:26
#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:1130
#define IDS_TOOLTIP_DISABLE
Definition: resource.h:48
#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:31
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_STATUSBAR
Definition: resource.h:12
#define MF_BYCOMMAND
Definition: winuser.h:202
#define SC_RESTORE
Definition: winuser.h:2573
UINT HintId
Definition: precomp.h:89
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:1009
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define IDM_DEVBYTYPE
Definition: resource.h:37
~CDeviceManager(void)
Definition: MainWindow.cpp:90
#define WS_EX_LTRREADING
Definition: winuser.h:393
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TB_SETSTATE
Definition: commctrl.h:1050
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)
static const MENU_HINT MainMenuHintTable[]
Definition: MainWindow.cpp:29
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IDS_TOOLTIP_PROPERTIES
Definition: resource.h:45
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
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:410
#define CALLBACK
Definition: compat.h:27
bool CreateActionMenu(_In_ HMENU OwnerMenu, _In_ bool MainMenu)
Definition: DeviceView.cpp:304
LONG top
Definition: windef.h:307
#define InterlockedCompareExchange
Definition: interlocked.h:104
bool CreateStatusBar(void)
Definition: MainWindow.cpp:337
#define SM_CYSMICON
Definition: winuser.h:1003
HICON hIcon
Definition: winuser.h:3197
struct @1604 Msg[]
UINT_PTR WPARAM
Definition: windef.h:207
HINSTANCE hInst
Definition: commctrl.h:1055
#define WS_CHILD
Definition: pedump.c:617
struct _WNDCLASSEXW WNDCLASSEXW
void UpdateToolbar(void)
Definition: MainWindow.cpp:364
LONG left
Definition: windef.h:306
#define IDI_MAIN_ICON
Definition: resource.h:8
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:308
#define STATUSCLASSNAME
Definition: commctrl.h:1935
BOOL WINAPI DestroyWindow(_In_ HWND)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
int32_t INT
Definition: typedefs.h:57
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define BTN_DISABLE_DRV
Definition: MainWindow.cpp:19
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:121
struct tagNMHDR * LPNMHDR
#define IDS_HINT_ENABLE
Definition: resource.h:70
UINT code
Definition: winuser.h:3134
static const MENU_HINT SystemMenuHintTable[]
Definition: MainWindow.cpp:56
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
void UpdateStatusBar(_In_ bool InMenuLoop)
Definition: MainWindow.cpp:235
#define BTN_UPDATE_DRV
Definition: MainWindow.cpp:20
#define CCS_NODIVIDER
Definition: commctrl.h:2244
#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:994
LPCWSTR lpszMenuName
Definition: winuser.h:3200
LRESULT OnSize(void)
Definition: MainWindow.cpp:462
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
ViewType GetCurrentView()
Definition: DeviceView.h:74
#define IDM_UNINSTALL_DRV
Definition: resource.h:27
long LONG
Definition: pedump.c:60
#define TB_AUTOSIZE
Definition: commctrl.h:1133
#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:39
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define SB_SIMPLEID
Definition: precomp.h:15
#define TTN_GETDISPINFO
Definition: commctrl.h:1874
#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:38
#define SB_SIMPLE
Definition: commctrl.h:1954
#define TOOLBARCLASSNAME
Definition: commctrl.h:942
#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:82
#define IDS_HINT_UNINSTALL
Definition: resource.h:73
CNode * GetSelectedNode()
Definition: DeviceView.cpp:320
void OnActivate(void)
Definition: MainWindow.cpp:692
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_TOOLTIP_SCAN
Definition: resource.h:46
#define false
Definition: osdep.h:35
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:3201
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:1886
#define IDS_HINT_SYS_MOVE
Definition: resource.h:119
#define IDM_RESBYCONN
Definition: resource.h:40
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define IDS_HINT_SCAN
Definition: resource.h:69
bool Initialize()
Definition: DeviceView.cpp:54
#define BTNS_SEP
Definition: commctrl.h:995
#define IDS_HINT_UPDATE
Definition: resource.h:72
#define SBARS_SIZEGRIP
Definition: commctrl.h:1919
#define WM_SIZE
Definition: winuser.h:1593
HBRUSH hbrBackground
Definition: winuser.h:3199
#define IDS_HINT_RES_BY_TYPE
Definition: resource.h:80
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
UINT cbSize
Definition: winuser.h:3191
#define _countof(array)
Definition: sndvol32.h:68
#define TVN_SELCHANGED
Definition: commctrl.h:3731
#define WM_TIMER
Definition: winuser.h:1724
bool RefreshView(_In_ ViewType Type, _In_ bool ScanForChanges)
Definition: MainWindow.cpp:244
#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:118
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:985
CDeviceView * m_DeviceView
Definition: MainWindow.h:13
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define IDM_ADD_HARDWARE
Definition: resource.h:28
#define TB_ADDBITMAP
Definition: commctrl.h:1052
HINSTANCE hInstance
Definition: winuser.h:3196
Definition: Node.h:9
#define BTN_PROPERTIES
Definition: MainWindow.cpp:16
#define SM_CXSMICON
Definition: winuser.h:1002
#define BTN_SCAN_HARDWARE
Definition: MainWindow.cpp:17
bool MainWndMenuHint(_In_ WORD CmdId, _In_ const MENU_HINT *HintArray, _In_ DWORD HintsCount, _In_ UINT DefHintId)
Definition: MainWindow.cpp:205
#define IDS_HINT_SYS_SIZE
Definition: resource.h:120
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
LRESULT OnCreate(_In_ HWND hwnd)
Definition: MainWindow.cpp:432
VOID SetHiddenDevices(_In_ bool ShowHidden)
Definition: DeviceView.h:69
#define IDS_HINT_DEV_BY_CONN
Definition: resource.h:79
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:125
bool CreateToolBar(void)
Definition: MainWindow.cpp:287
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:1945
#define COLOR_BTNFACE
Definition: winuser.h:918
#define TB_ADDBUTTONSW
Definition: commctrl.h:1262
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define IDM_PROPERTIES
Definition: resources.h:9
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1132
HCURSOR hCursor
Definition: winuser.h:3198
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:5787
#define InterlockedExchange
Definition: armddk.h:54
WNDPROC lpfnWndProc
Definition: winuser.h:3193
#define BTN_UNINSTALL_DRV
Definition: MainWindow.cpp:21
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:23
#define IDS_HINT_DISABLE
Definition: resource.h:71
enum State_ State
Definition: pofuncs.h:54
HINSTANCE hInst
Definition: dxdiag.c:13
#define REFRESH_TIMER
Definition: MainWindow.cpp:23
#define WM_ACTIVATE
Definition: winuser.h:1594
#define NM_DBLCLK
Definition: commctrl.h:131
static TBBUTTON TbButtons[]
Definition: MainWindow.cpp:66
LRESULT OnDestroy(void)
Definition: MainWindow.cpp:698
#define IDM_DISABLE_DRV
Definition: resource.h:25
HICON hIcon
Definition: msconfig.c:44
#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:80
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:25
unsigned int UINT
Definition: ndis.h:50
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:717
CAtlStringW m_szMainWndClass
Definition: MainWindow.h:12
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:122
#define IDM_EXIT
Definition: resource.h:27
#define SB_SETPARTS
Definition: commctrl.h:1950
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:3202
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:47
#define IDM_SHOWHIDDEN
Definition: resource.h:41
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TBSTATE_HIDDEN
Definition: commctrl.h:971
#define SendMessage
Definition: winuser.h:5818
bool Create(_In_ HWND hWndParent, _In_ HINSTANCE hInst, _In_opt_z_ LPCWSTR lpMachineName, _In_ int nCmdShow)
Definition: MainWindow.cpp:95
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define WM_CREATE
Definition: winuser.h:1590
#define IDS_HINT_SYS_CLOSE
Definition: resource.h:123
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:986
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:309
#define IDB_TOOLBAR
Definition: wordpad.h:183
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define LoadImage
Definition: winuser.h:5790
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BTN_ENABLE_DRV
Definition: MainWindow.cpp:18
#define LoadIcon
Definition: winuser.h:5788
#define IDS_HINT_DEV_BY_TYPE
Definition: resource.h:78
#define GetWindowLongPtr
Definition: treelist.c:73
HINSTANCE g_hParentInstance
Definition: MainWindow.cpp:26
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 IDS_APP_AUTHORS
Definition: resource.h:120
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:24
#define TBSTYLE_FLAT
Definition: commctrl.h:988
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1186
#define IDS_HINT_PROPERTIES
Definition: resource.h:68
#define WM_NOTIFY
Definition: richedit.h:61
Definition: dlist.c:348
UINT_PTR nID
Definition: commctrl.h:1056
void Uninitialize(void)
Definition: MainWindow.cpp:183