ReactOS 0.4.17-dev-1190-g4c812f4
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 m_ClosePending(false)
87{
88 m_szMainWndClass = L"DevMgmtWndClass";
89}
90
92{
93}
94
95bool
98 _In_opt_z_ LPCWSTR /*lpMachineName*/,
99 _In_ int nCmdShow)
100{
101 CDeviceManager MainWindow;
103 CAtlStringW szAppName;
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);
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
135bool
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);
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
183void
185{
186 // Unregister the window class
188}
189
190int
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
205bool
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
230 HintId);
231
232 return Found;
233}
234
235void
237{
239 SB_SIMPLE,
240 (WPARAM)InMenuLoop,
241 0);
242}
243
244bool
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
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:
274 break;
275 }
276
277 // Set the new check item
281 CheckId,
283
284 return true;
285}
286
287bool
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,
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
337bool
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,
352 NULL);
353 if (m_hStatusBar)
354 {
355 // Set the width
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
410bool
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,
425 (WPARAM)PartId,
426 (LPARAM)szMessage.GetBuffer()) != 0);
427 }
428
429 return bRet;
430}
431
434{
435 LRESULT RetCode;
436
437 RetCode = -1;
439
440 // Store a handle to the main menu
442
443 // Create the toolbar and statusbar
445 {
446 // Create the device view object
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
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
490 iToolHeight,
491 rcClient.right,
492 lvHeight);
493
494 return 0;
495}
496
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);
514 break;
515 }
516
517 case NM_DBLCLK:
518 {
519 Ret = m_DeviceView->OnDoubleClick(NmHdr);
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;
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;
559 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
560 break;
561 }
562 break;
563 }
564 }
565
566 return Ret;
567}
568
571{
573}
574
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:
589 case IDM_ENABLE_DRV:
590 case IDM_DISABLE_DRV:
591 case IDM_UPDATE_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,
616 NULL);
617
618 DestroyMenu(hMenu);
619 break;
620 }
621
622 case IDM_DEVBYTYPE:
623 {
625 break;
626 }
627
628 case IDM_DEVBYCONN:
629 {
631 break;
632 }
633
634 case IDM_RESBYTYPE:
635 {
637 break;
638 }
639
640 case IDM_SHOWHIDDEN:
641 {
642 // Get the current state
644 if (CurCheckState == MF_CHECKED)
645 {
648 }
649 else if (CurCheckState == MF_UNCHECKED)
650 {
653 }
654 // Refresh the device view
656 break;
657 }
658
659 case IDM_ABOUT:
660 {
661 CAtlStringW szAppName;
662 CAtlStringW szAppAuthors;
663
664 if (!szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
665 szAppName = L"ReactOS Device Manager";
666 if (!szAppAuthors.LoadStringW(g_hThisInstance, IDS_APP_AUTHORS))
667 szAppAuthors = L"";
668 ShellAboutW(m_hMainWnd, szAppName, szAppAuthors,
670
671 // Set focus back to the treeview
673 break;
674 }
675
676 case IDM_EXIT:
677 {
678 // Post a close message to the window
680 WM_CLOSE,
681 0,
682 0);
683 break;
684 }
685
686 default:
687 // We didn't handle it
688 RetCode = -1;
689 break;
690 }
691
692 return RetCode;
693}
694
695void
697{
699}
700
703{
704 // Uninitialize the device view
706
707 // Kill the object
708 delete m_DeviceView;
710
711 // Clear the user data pointer
713
714 // Break the message loop
716
717 return 0;
718}
719
722 _In_ UINT msg,
725{
727 LRESULT RetCode = 0;
728
729 // Get the object pointer from window context
731 if (This == NULL)
732 {
733 // Check that this isn't a create message
734 if (msg != WM_CREATE)
735 {
736 // Don't handle null info pointer
737 goto HandleDefaultMessage;
738 }
739 }
740
741 switch(msg)
742 {
743 case WM_CREATE:
744 {
745 // Get the object pointer from the create param
746 This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
747
748 // Store the pointer in the window's global user data
750
751 // Call the create handler
752 RetCode = This->OnCreate(hwnd);
753 break;
754 }
755
756 case WM_SIZE:
757 {
758 RetCode = This->OnSize();
759 break;
760 }
761
762 case WM_NOTIFY:
763 {
764 RetCode = This->OnNotify(lParam);
765 break;
766 }
767
768 case WM_CONTEXTMENU:
769 {
770 RetCode = This->OnContext(lParam);
771 break;
772 }
773
774 case WM_MENUSELECT:
775 {
776 if (This->m_hStatusBar != NULL)
777 {
778 if (!This->MainWndMenuHint(LOWORD(wParam),
780 sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
782 {
783 This->MainWndMenuHint(LOWORD(wParam),
785 sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
787 }
788 }
789
790 break;
791 }
792
793 case WM_COMMAND:
794 {
795 // Handle the command message
796 RetCode = This->OnCommand(wParam, lParam);
797 if (RetCode == -1)
798 {
799 // Hand it off to the default message handler
800 goto HandleDefaultMessage;
801 }
802 break;
803 }
804
805 case WM_DEVICECHANGE:
806 {
808 {
809 //
810 // The OS can send multiple change messages in quick succession. To avoid
811 // refreshing multiple times (and to avoid waiting in the message thread)
812 // we set a timer to run in 500ms, which should leave enough time for all
813 // the messages to come through. Wrap so we don't set multiple timers
814 //
815 if (InterlockedCompareExchange((LONG *)&This->m_RefreshPending, TRUE, FALSE) == FALSE)
816 {
818 }
819 }
820 break;
821 }
822
823 case WM_TIMER:
824 {
825 if (wParam == REFRESH_TIMER)
826 {
827 // Schedule a refresh (this just creates a thread and returns)
828 This->RefreshView(This->m_DeviceView->GetCurrentView(), true);
829
830 // Cleanup the timer
832
833 // Allow more change notifications
834 InterlockedExchange((LONG *)&This->m_RefreshPending, FALSE);
835 }
836 break;
837 }
838
840 {
841 This->m_DeviceView->OnRefreshComplete();
842
843 if (This->m_ClosePending && !This->m_DeviceView->IsRefreshing())
845 break;
846 }
847
848 case WM_ENTERMENULOOP:
849 {
850 This->UpdateStatusBar(true);
851 break;
852 }
853
854 case WM_EXITMENULOOP:
855 {
856 This->UpdateStatusBar(false);
857 break;
858 }
859
860 case WM_CLOSE:
861 {
862 // The refresh thread still uses the device view, so close once it posts back
863 if (This->m_DeviceView->IsRefreshing())
864 {
865 This->m_ClosePending = true;
866 break;
867 }
868
869 // Destroy the main window
871 break;
872 }
873
874 case WM_ACTIVATE:
875 {
876 if (LOWORD(hwnd))
877 This->OnActivate();
878 break;
879 }
880
881 case WM_DESTROY:
882 {
883 // Call the destroy handler
884 RetCode = This->OnDestroy();
885 break;
886 }
887
888 default:
889 {
890HandleDefaultMessage:
891 RetCode = DefWindowProc(hwnd, msg, wParam, lParam);
892 break;
893 }
894 }
895
896 return RetCode;
897}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
static TBBUTTON TbButtons[]
Definition: CMainWnd.cpp:12
ViewType
Definition: DeviceView.h:9
@ DevicesByConnection
Definition: DeviceView.h:11
@ ResourcesByType
Definition: DeviceView.h:12
@ ResourcesByConnection
Definition: DeviceView.h:13
@ DevicesByType
Definition: DeviceView.h:10
#define WM_REFRESH_COMPLETE
Definition: DeviceView.h:16
@ 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
#define IDB_TOOLBAR
Definition: resource.h:19
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:93
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:138
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:365
bool CreateStatusBar(void)
Definition: MainWindow.cpp:338
LRESULT OnCreate(_In_ HWND hwnd)
Definition: MainWindow.cpp:433
CDeviceManager(void)
Definition: MainWindow.cpp:80
bool CreateToolBar(void)
Definition: MainWindow.cpp:288
LRESULT OnContext(_In_ LPARAM lParam)
Definition: MainWindow.cpp:570
LRESULT OnCommand(_In_ WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:576
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: MainWindow.cpp:721
HWND m_hStatusBar
Definition: MainWindow.h:15
LRESULT OnSize(void)
Definition: MainWindow.cpp:463
bool RefreshView(_In_ ViewType Type, _In_ bool ScanForChanges)
Definition: MainWindow.cpp:245
bool Create(_In_ HWND hWndParent, _In_ HINSTANCE hInst, _In_opt_z_ LPCWSTR lpMachineName, _In_ int nCmdShow)
Definition: MainWindow.cpp:96
void OnActivate(void)
Definition: MainWindow.cpp:696
CDeviceView * m_DeviceView
Definition: MainWindow.h:13
bool StatusBarLoadString(_In_ HWND hStatusBar, _In_ INT PartId, _In_ HINSTANCE hInstance, _In_ UINT uID)
Definition: MainWindow.cpp:411
CAtlStringW m_szMainWndClass
Definition: MainWindow.h:12
LRESULT OnNotify(_In_ LPARAM lParam)
Definition: MainWindow.cpp:498
LRESULT OnDestroy(void)
Definition: MainWindow.cpp:702
~CDeviceManager(void)
Definition: MainWindow.cpp:91
void Uninitialize(void)
Definition: MainWindow.cpp:184
void UpdateStatusBar(_In_ bool InMenuLoop)
Definition: MainWindow.cpp:236
bool Initialize(_In_z_ LPCTSTR lpCaption, _In_ int nCmdShow)
Definition: MainWindow.cpp:136
bool MainWndMenuHint(_In_ WORD CmdId, _In_ const MENU_HINT *HintArray, _In_ DWORD HintsCount, _In_ UINT DefHintId)
Definition: MainWindow.cpp:206
virtual bool IsDisabled()
Definition: DeviceNode.cpp:219
bool CanDisable()
Definition: DeviceNode.cpp:202
VOID SetHiddenDevices(_In_ bool ShowHidden)
Definition: DeviceView.h:81
CNode * GetSelectedNode()
Definition: DeviceView.cpp:352
LRESULT OnSize(_In_ int x, _In_ int y, _In_ int cx, _In_ int cy)
Definition: DeviceView.cpp:111
VOID DisplayPropertySheet()
Definition: DeviceView.cpp:316
VOID SetFocus()
Definition: DeviceView.cpp:330
ViewType GetCurrentView()
Definition: DeviceView.h:86
VOID Refresh(_In_ ViewType Type, _In_ bool ScanForChanges, _In_ bool UpdateView)
Definition: DeviceView.cpp:219
bool Uninitialize()
Definition: DeviceView.cpp:97
LRESULT OnAction(UINT Action)
Definition: DeviceView.cpp:254
LRESULT OnRightClick(_In_ LPNMHDR NmHdr)
Definition: DeviceView.cpp:152
bool Initialize()
Definition: DeviceView.cpp:57
bool CreateActionMenu(_In_ HMENU OwnerMenu, _In_ bool MainMenu)
Definition: DeviceView.cpp:336
LRESULT OnContextMenu(_In_ LPARAM lParam)
Definition: DeviceView.cpp:172
LRESULT OnDoubleClick(_In_ LPNMHDR NmHdr)
Definition: DeviceView.cpp:131
Definition: Node.h:15
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1898 Msg[]
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:904
#define DBT_DEVNODES_CHANGED
Definition: dbt.h:28
HINSTANCE g_hParentInstance
Definition: MainWindow.cpp:26
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:25
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT _Out_ UINT * Height
Definition: dispmprt.h:1445
#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
#define false
Definition: stdbool.h:25
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
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
unsigned int UINT
Definition: sysinfo.c:13
#define InterlockedCompareExchange
Definition: interlocked.h:119
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#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:60
LPCSTR LPCTSTR
Definition: ms-dtyp.idl:130
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define _In_z_
Definition: no_sal2.h:164
#define _In_opt_z_
Definition: no_sal2.h:218
#define _In_
Definition: no_sal2.h:158
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#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
_In_ UINT uID
Definition: shlwapi.h:156
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define WM_CLOSE
Definition: winuser.h:1649
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
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:2416
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1639
#define WM_COMMAND
Definition: winuser.h:1768
#define IDC_ARROW
Definition: winuser.h:695
#define SM_CYSMICON
Definition: winuser.h:1024
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define WM_DEVICECHANGE
Definition: winuser.h:1839
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:2620
#define WM_ACTIVATE
Definition: winuser.h:1640
#define SC_MINIMIZE
Definition: winuser.h:2622
#define SM_CXSMICON
Definition: winuser.h:1023
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_ENTERMENULOOP
Definition: winuser.h:1832
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_TIMER
Definition: winuser.h:1770
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:5979
struct tagNMHDR * LPNMHDR
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define SendMessage
Definition: winuser.h:6009
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LoadCursor
Definition: winuser.h:5978
#define WM_EXITMENULOOP
Definition: winuser.h:1833
#define SC_CLOSE
Definition: winuser.h:2628
#define SC_MOVE
Definition: winuser.h:2621
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:5981
BOOL WINAPI DestroyMenu(_In_ HMENU)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
struct _WNDCLASSEXW WNDCLASSEXW
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
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:1775
#define SC_RESTORE
Definition: winuser.h:2634
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_LEFT
Definition: winuser.h:391
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
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:2624
#define COLOR_BTNFACE
Definition: winuser.h:939
#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
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
UINT HintId
Definition: precomp.h:90
LPCWSTR lpszClassName
Definition: winuser.h:3334
LPCWSTR lpszMenuName
Definition: winuser.h:3333
HBRUSH hbrBackground
Definition: winuser.h:3332
WNDPROC lpfnWndProc
Definition: winuser.h:3326
UINT cbSize
Definition: winuser.h:3324
HCURSOR hCursor
Definition: winuser.h:3331
HICON hIconSm
Definition: winuser.h:3335
HINSTANCE hInstance
Definition: winuser.h:3329
HICON hIcon
Definition: winuser.h:3330
UINT code
Definition: winuser.h:3267
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
const uint16_t * LPCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
Definition: dlist.c:348
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define IDC_TOOLBAR
Definition: wordpad.h:157