ReactOS 0.4.16-dev-197-g92996da
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
30{
31 // File Menu
33
34 // Action Menu
42
43 // View Menu
49
51
52};
53
54
55// system menu hints
57{
64};
65
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
94bool
97 _In_opt_z_ LPCWSTR /*lpMachineName*/,
98 _In_ int nCmdShow)
99{
100 CDeviceManager MainWindow;
102 CAtlStringW szAppName;
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);
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
134bool
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);
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
182void
184{
185 // Unregister the window class
187}
188
189int
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
204bool
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
229 HintId);
230
231 return Found;
232}
233
234void
236{
238 SB_SIMPLE,
239 (WPARAM)InMenuLoop,
240 0);
241}
242
243bool
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
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:
273 break;
274 }
275
276 // Set the new check item
280 CheckId,
282
283 return true;
284}
285
286bool
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,
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
336bool
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,
351 NULL);
352 if (m_hStatusBar)
353 {
354 // Set the width
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
409bool
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,
424 (WPARAM)PartId,
425 (LPARAM)szMessage.GetBuffer()) != 0);
426 }
427
428 return bRet;
429}
430
433{
434 LRESULT RetCode;
435
436 RetCode = -1;
438
439 // Store a handle to the main menu
441
442 // Create the toolbar and statusbar
444 {
445 // Create the device view object
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
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
489 iToolHeight,
490 rcClient.right,
491 lvHeight);
492
493 return 0;
494}
495
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);
513 break;
514 }
515
516 case NM_DBLCLK:
517 {
518 Ret = m_DeviceView->OnDoubleClick(NmHdr);
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;
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;
558 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
559 break;
560 }
561 break;
562 }
563 }
564
565 return Ret;
566}
567
570{
572}
573
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:
588 case IDM_ENABLE_DRV:
589 case IDM_DISABLE_DRV:
590 case IDM_UPDATE_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,
615 NULL);
616
617 DestroyMenu(hMenu);
618 break;
619 }
620
621 case IDM_DEVBYTYPE:
622 {
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 {
654 CAtlStringW szAppName;
655 CAtlStringW szAppAuthors;
656
657 if (!szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
658 szAppName = L"ReactOS Device Manager";
659 if (!szAppAuthors.LoadStringW(g_hThisInstance, IDS_APP_AUTHORS))
660 szAppAuthors = L"";
661 ShellAboutW(m_hMainWnd, szAppName, szAppAuthors,
663
664 // Set focus back to the treeview
666 break;
667 }
668
669 case IDM_EXIT:
670 {
671 // Post a close message to the window
673 WM_CLOSE,
674 0,
675 0);
676 break;
677 }
678
679 default:
680 // We didn't handle it
681 RetCode = -1;
682 break;
683 }
684
685 return RetCode;
686}
687
688void
690{
692}
693
696{
697 // Uninitialize the device view
699
700 // Kill the object
701 delete m_DeviceView;
703
704 // Clear the user data pointer
706
707 // Break the message loop
709
710 return 0;
711}
712
715 _In_ UINT msg,
718{
720 LRESULT RetCode = 0;
721
722 // Get the object pointer from window context
724 if (This == NULL)
725 {
726 // Check that this isn't a create message
727 if (msg != WM_CREATE)
728 {
729 // Don't handle null info pointer
730 goto HandleDefaultMessage;
731 }
732 }
733
734 switch(msg)
735 {
736 case WM_CREATE:
737 {
738 // Get the object pointer from the create param
739 This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
740
741 // Store the pointer in the window's global user data
743
744 // Call the create handler
745 RetCode = This->OnCreate(hwnd);
746 break;
747 }
748
749 case WM_SIZE:
750 {
751 RetCode = This->OnSize();
752 break;
753 }
754
755 case WM_NOTIFY:
756 {
757 RetCode = This->OnNotify(lParam);
758 break;
759 }
760
761 case WM_CONTEXTMENU:
762 {
763 RetCode = This->OnContext(lParam);
764 break;
765 }
766
767 case WM_MENUSELECT:
768 {
769 if (This->m_hStatusBar != NULL)
770 {
771 if (!This->MainWndMenuHint(LOWORD(wParam),
773 sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
775 {
776 This->MainWndMenuHint(LOWORD(wParam),
778 sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
780 }
781 }
782
783 break;
784 }
785
786 case WM_COMMAND:
787 {
788 // Handle the command message
789 RetCode = This->OnCommand(wParam, lParam);
790 if (RetCode == -1)
791 {
792 // Hand it off to the default message handler
793 goto HandleDefaultMessage;
794 }
795 break;
796 }
797
798 case WM_DEVICECHANGE:
799 {
801 {
802 //
803 // The OS can send multiple change messages in quick succession. To avoid
804 // refreshing multiple times (and to avoid waiting in the message thread)
805 // we set a timer to run in 500ms, which should leave enough time for all
806 // the messages to come through. Wrap so we don't set multiple timers
807 //
808 if (InterlockedCompareExchange((LONG *)&This->m_RefreshPending, TRUE, FALSE) == FALSE)
809 {
811 }
812 }
813 break;
814 }
815
816 case WM_TIMER:
817 {
818 if (wParam == REFRESH_TIMER)
819 {
820 // Schedule a refresh (this just creates a thread and returns)
821 This->RefreshView(This->m_DeviceView->GetCurrentView(), true);
822
823 // Cleanup the timer
825
826 // Allow more change notifications
827 InterlockedExchange((LONG *)&This->m_RefreshPending, FALSE);
828 }
829 break;
830 }
831
832 case WM_ENTERMENULOOP:
833 {
834 This->UpdateStatusBar(true);
835 break;
836 }
837
838 case WM_EXITMENULOOP:
839 {
840 This->UpdateStatusBar(false);
841 break;
842 }
843
844 case WM_CLOSE:
845 {
846 // Destroy the main window
848 break;
849 }
850
851 case WM_ACTIVATE:
852 {
853 if (LOWORD(hwnd))
854 This->OnActivate();
855 break;
856 }
857
858 case WM_DESTROY:
859 {
860 // Call the destroy handler
861 RetCode = This->OnDestroy();
862 break;
863 }
864
865 default:
866 {
867HandleDefaultMessage:
868 RetCode = DefWindowProc(hwnd, msg, wParam, lParam);
869 break;
870 }
871 }
872
873 return RetCode;
874}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
ViewType
Definition: DeviceView.h:7
@ DevicesByConnection
Definition: DeviceView.h:9
@ ResourcesByType
Definition: DeviceView.h:10
@ ResourcesByConnection
Definition: DeviceView.h:11
@ DevicesByType
Definition: DeviceView.h:8
@ DeviceNode
Definition: Node.h:9
Type
Definition: Type.h:7
#define InterlockedExchange
Definition: armddk.h:54
#define msg(x)
Definition: auth_time.c:54
#define IDC_STATIC
Definition: resource.h:4
#define IDM_ABOUT
Definition: resource.h:29
#define IDM_EXIT
Definition: resource.h:27
#define IDS_APPNAME
Definition: resource.h:52
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:70
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:40
#define IDS_HINT_SYS_CLOSE
Definition: resource.h:123
#define IDC_STATUSBAR
Definition: resource.h:12
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:121
#define IDS_HINT_EXIT
Definition: resource.h:94
#define IDS_HINT_SYS_SIZE
Definition: resource.h:120
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:118
#define IDS_HINT_ABOUT
Definition: resource.h:115
#define IDS_HINT_BLANK
Definition: resource.h:92
#define IDS_HINT_SYS_MOVE
Definition: resource.h:119
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:122
#define IDS_APP_AUTHORS
Definition: resource.h:92
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:133
HWND hStatusBar
Definition: main.c:23
#define IDM_MAINMENU
Definition: resources.h:3
#define IDM_PROPERTIES
Definition: resources.h:9
return Found
Definition: dirsup.c:1270
HINSTANCE hInstance
Definition: charmap.c:19
void UpdateToolbar(void)
Definition: MainWindow.cpp:364
bool CreateStatusBar(void)
Definition: MainWindow.cpp:337
LRESULT OnCreate(_In_ HWND hwnd)
Definition: MainWindow.cpp:432
CDeviceManager(void)
Definition: MainWindow.cpp:80
bool CreateToolBar(void)
Definition: MainWindow.cpp:287
LRESULT OnContext(_In_ LPARAM lParam)
Definition: MainWindow.cpp:569
LRESULT OnCommand(_In_ WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:575
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:714
HWND m_hStatusBar
Definition: MainWindow.h:15
LRESULT OnSize(void)
Definition: MainWindow.cpp:462
bool RefreshView(_In_ ViewType Type, _In_ bool ScanForChanges)
Definition: MainWindow.cpp:244
bool Create(_In_ HWND hWndParent, _In_ HINSTANCE hInst, _In_opt_z_ LPCWSTR lpMachineName, _In_ int nCmdShow)
Definition: MainWindow.cpp:95
void OnActivate(void)
Definition: MainWindow.cpp:689
CDeviceView * m_DeviceView
Definition: MainWindow.h:13
bool StatusBarLoadString(_In_ HWND hStatusBar, _In_ INT PartId, _In_ HINSTANCE hInstance, _In_ UINT uID)
Definition: MainWindow.cpp:410
CAtlStringW m_szMainWndClass
Definition: MainWindow.h:12
LRESULT OnNotify(_In_ LPARAM lParam)
Definition: MainWindow.cpp:497
LRESULT OnDestroy(void)
Definition: MainWindow.cpp:695
~CDeviceManager(void)
Definition: MainWindow.cpp:90
void Uninitialize(void)
Definition: MainWindow.cpp:183
void UpdateStatusBar(_In_ bool InMenuLoop)
Definition: MainWindow.cpp:235
bool Initialize(_In_z_ LPCTSTR lpCaption, _In_ int nCmdShow)
Definition: MainWindow.cpp:135
bool MainWndMenuHint(_In_ WORD CmdId, _In_ const MENU_HINT *HintArray, _In_ DWORD HintsCount, _In_ UINT DefHintId)
Definition: MainWindow.cpp:205
virtual bool IsDisabled()
Definition: DeviceNode.cpp:219
bool CanDisable()
Definition: DeviceNode.cpp:202
VOID SetHiddenDevices(_In_ bool ShowHidden)
Definition: DeviceView.h:73
CNode * GetSelectedNode()
Definition: DeviceView.cpp:341
LRESULT OnSize(_In_ int x, _In_ int y, _In_ int cx, _In_ int cy)
Definition: DeviceView.cpp:108
VOID DisplayPropertySheet()
Definition: DeviceView.cpp:305
VOID SetFocus()
Definition: DeviceView.cpp:319
ViewType GetCurrentView()
Definition: DeviceView.h:78
VOID Refresh(_In_ ViewType Type, _In_ bool ScanForChanges, _In_ bool UpdateView)
Definition: DeviceView.cpp:216
bool Uninitialize()
Definition: DeviceView.cpp:94
LRESULT OnAction(UINT Action)
Definition: DeviceView.cpp:243
LRESULT OnRightClick(_In_ LPNMHDR NmHdr)
Definition: DeviceView.cpp:149
bool Initialize()
Definition: DeviceView.cpp:54
bool CreateActionMenu(_In_ HMENU OwnerMenu, _In_ bool MainMenu)
Definition: DeviceView.cpp:325
LRESULT OnContextMenu(_In_ LPARAM lParam)
Definition: DeviceView.cpp:169
LRESULT OnDoubleClick(_In_ LPNMHDR NmHdr)
Definition: DeviceView.cpp:128
Definition: Node.h:13
struct @1636 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define DBT_DEVNODES_CHANGED
Definition: dbt.h:28
HINSTANCE g_hParentInstance
Definition: MainWindow.cpp:26
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:25
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
#define BTN_PROPERTIES
Definition: MainWindow.cpp:16
#define BTN_DISABLE_DRV
Definition: MainWindow.cpp:19
#define REFRESH_TIMER
Definition: MainWindow.cpp:23
HINSTANCE g_hParentInstance
Definition: MainWindow.cpp:26
static const MENU_HINT SystemMenuHintTable[]
Definition: MainWindow.cpp:56
#define BTN_UPDATE_DRV
Definition: MainWindow.cpp:20
#define BTN_ENABLE_DRV
Definition: MainWindow.cpp:18
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:25
static const MENU_HINT MainMenuHintTable[]
Definition: MainWindow.cpp:29
#define BTN_SCAN_HARDWARE
Definition: MainWindow.cpp:17
static TBBUTTON TbButtons[]
Definition: MainWindow.cpp:66
#define BTN_UNINSTALL_DRV
Definition: MainWindow.cpp:21
#define IDS_HINT_UPDATE
Definition: resource.h:73
#define IDS_HINT_DISABLE
Definition: resource.h:72
#define IDS_HINT_DEV_BY_CONN
Definition: resource.h:80
#define IDS_HINT_SHOW_HIDDEN
Definition: resource.h:83
#define IDM_UPDATE_DRV
Definition: resource.h:26
#define IDS_TOOLTIP_PROPERTIES
Definition: resource.h:45
#define IDS_TOOLTIP_SCAN
Definition: resource.h:46
#define IDM_SHOWHIDDEN
Definition: resource.h:41
#define IDS_HINT_SCAN
Definition: resource.h:70
#define IDM_SCAN_HARDWARE
Definition: resource.h:23
#define IDM_DEVBYTYPE
Definition: resource.h:37
#define IDS_TOOLTIP_DISABLE
Definition: resource.h:48
#define IDS_HINT_DEV_BY_TYPE
Definition: resource.h:79
#define IDS_HINT_UNINSTALL
Definition: resource.h:74
#define IDS_TOOLTIP_UPDATE
Definition: resource.h:49
#define IDS_HINT_ADD
Definition: resource.h:75
#define IDS_HINT_RES_BY_TYPE
Definition: resource.h:81
#define IDM_UNINSTALL_DRV
Definition: resource.h:27
#define IDS_HINT_ENABLE
Definition: resource.h:71
#define IDM_ENABLE_DRV
Definition: resource.h:24
#define IDM_DISABLE_DRV
Definition: resource.h:25
#define IDM_ACTIONMENU
Definition: resource.h:31
#define IDM_DEVBYCONN
Definition: resource.h:38
#define IDS_HINT_RES_BY_CONN
Definition: resource.h:82
#define IDS_TOOLTIP_ENABLE
Definition: resource.h:47
#define IDS_HINT_PROPERTIES
Definition: resource.h:69
#define IDM_ADD_HARDWARE
Definition: resource.h:28
#define IDM_RESBYCONN
Definition: resource.h:40
#define IDM_RESBYTYPE
Definition: resource.h:39
#define IDI_MAIN_ICON
Definition: resource.h:8
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
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
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define SB_SIMPLEID
Definition: precomp.h:15
static HICON
Definition: imagelist.c:80
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define _In_z_
Definition: ms_sal.h:313
#define _In_opt_z_
Definition: ms_sal.h:314
#define _In_
Definition: ms_sal.h:308
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TVN_SELCHANGED
Definition: commctrl.h:3740
#define SB_SIMPLE
Definition: commctrl.h:1963
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define NM_DBLCLK
Definition: commctrl.h:131
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TB_SETSTATE
Definition: commctrl.h:1054
#define BTNS_SEP
Definition: commctrl.h:999
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TTN_GETDISPINFO
Definition: commctrl.h:1883
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define NM_RETURN
Definition: commctrl.h:132
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define NM_RCLICK
Definition: commctrl.h:133
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define SB_SETTEXT
Definition: commctrl.h:1954
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define SB_SETPARTS
Definition: commctrl.h:1959
#define SBARS_SIZEGRIP
Definition: commctrl.h:1928
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
#define STATUSCLASSNAME
Definition: commctrl.h:1944
#define TB_ADDBITMAP
Definition: commctrl.h:1056
#define LPTOOLTIPTEXT
Definition: commctrl.h:1895
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define _countof(array)
Definition: sndvol32.h:70
TCHAR szAppName[128]
Definition: solitaire.cpp:18
#define false
Definition: stdbool.h:37
UINT HintId
Definition: precomp.h:90
LPCWSTR lpszClassName
Definition: winuser.h:3229
LPCWSTR lpszMenuName
Definition: winuser.h:3228
HBRUSH hbrBackground
Definition: winuser.h:3227
WNDPROC lpfnWndProc
Definition: winuser.h:3221
UINT cbSize
Definition: winuser.h:3219
HCURSOR hCursor
Definition: winuser.h:3226
HICON hIconSm
Definition: winuser.h:3230
HINSTANCE hInstance
Definition: winuser.h:3224
HICON hIcon
Definition: winuser.h:3225
UINT code
Definition: winuser.h:3162
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
UINT_PTR nID
Definition: commctrl.h:1060
HINSTANCE hInst
Definition: commctrl.h:1059
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
Definition: dlist.c:348
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define WM_CLOSE
Definition: winuser.h:1624
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMAGE_ICON
Definition: winuser.h:212
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define TPM_RIGHTBUTTON
Definition: winuser.h:2383
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define IDC_ARROW
Definition: winuser.h:687
#define SM_CYSMICON
Definition: winuser.h:1016
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define WM_DEVICECHANGE
Definition: winuser.h:1814
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define MF_UNCHECKED
Definition: winuser.h:204
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SC_SIZE
Definition: winuser.h:2587
#define WM_ACTIVATE
Definition: winuser.h:1615
#define SC_MINIMIZE
Definition: winuser.h:2589
#define SM_CXSMICON
Definition: winuser.h:1015
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_ENTERMENULOOP
Definition: winuser.h:1807
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_TIMER
Definition: winuser.h:1745
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)
#define MF_BYPOSITION
Definition: winuser.h:203
#define LoadIcon
Definition: winuser.h:5825
struct tagNMHDR * LPNMHDR
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define SendMessage
Definition: winuser.h:5855
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LoadCursor
Definition: winuser.h:5824
#define WM_EXITMENULOOP
Definition: winuser.h:1808
#define SC_CLOSE
Definition: winuser.h:2595
#define SC_MOVE
Definition: winuser.h:2588
BOOL WINAPI GetMenuItemRect(_In_opt_ HWND, _In_ HMENU, _In_ UINT, _Out_ LPRECT)
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define LoadImage
Definition: winuser.h:5827
BOOL WINAPI DestroyMenu(_In_ HMENU)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
struct _WNDCLASSEXW WNDCLASSEXW
#define SW_SHOW
Definition: winuser.h:778
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define WM_MENUSELECT
Definition: winuser.h:1750
#define SC_RESTORE
Definition: winuser.h:2601
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_LEFT
Definition: winuser.h:391
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define SC_MAXIMIZE
Definition: winuser.h:2591
#define COLOR_BTNFACE
Definition: winuser.h:931
#define IDB_TOOLBAR
Definition: wordpad.h:183
#define IDC_TOOLBAR
Definition: wordpad.h:157
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185