ReactOS 0.4.15-dev-8339-g4028de8
propsheet.c File Reference
#include "precomp.h"
Include dependency graph for propsheet.c:

Go to the source code of this file.

Functions

unsigned int __stdcall PropSheetThread (void *Param)
 
static VOID InitPropSheetPage (PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
 
VOID OpenPropSheet (PMAIN_WND_INFO Info)
 

Function Documentation

◆ InitPropSheetPage()

static VOID InitPropSheetPage ( PROPSHEETPAGE psp,
PSERVICEPROPSHEET  dlgInfo,
WORD  idDlg,
DLGPROC  DlgProc 
)
static

Definition at line 15 of file propsheet.c.

19{
20 ZeroMemory(psp, sizeof(PROPSHEETPAGE));
21 psp->dwSize = sizeof(PROPSHEETPAGE);
22 psp->dwFlags = PSP_DEFAULT;
23 psp->hInstance = hInstance;
24 psp->pszTemplate = MAKEINTRESOURCE(idDlg);
25 psp->pfnDlgProc = DlgProc;
26 psp->lParam = (LPARAM)dlgInfo;
27}
HINSTANCE hInstance
Definition: charmap.c:19
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
#define PROPSHEETPAGE
Definition: prsht.h:389
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by KeyboardApplet(), MouseApplet(), PropSheetThread(), and SpeakerVolume().

◆ OpenPropSheet()

VOID OpenPropSheet ( PMAIN_WND_INFO  Info)

Definition at line 30 of file propsheet.c.

31{
32 PSERVICEPROPSHEET pServicePropSheet;
34
35 pServicePropSheet = HeapAlloc(ProcessHeap,
36 0,
37 sizeof(*pServicePropSheet));
38 if (!pServicePropSheet) return;
39
40 /* Set the current service in this calling thread to avoid
41 * it being updated before the thread is up */
42 pServicePropSheet->pService = Info->pCurrentService;
43 pServicePropSheet->Info = Info;
44
45 hThread = (HANDLE)_beginthreadex(NULL, 0, &PropSheetThread, pServicePropSheet, 0, NULL);
46 if (hThread)
47 {
49 }
50}
HANDLE ProcessHeap
Definition: servman.c:15
unsigned int __stdcall PropSheetThread(void *Param)
Definition: propsheet.c:53
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define HeapAlloc
Definition: compat.h:733
HANDLE hThread
Definition: wizard.c:28
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:132
PMAIN_WND_INFO Info
Definition: precomp.h:131
PVOID HANDLE
Definition: typedefs.h:73
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by MainWndCommand().

◆ PropSheetThread()

unsigned int __stdcall PropSheetThread ( void Param)

Definition at line 53 of file propsheet.c.

54{
55 PSERVICEPROPSHEET pServicePropSheet;
57 PROPSHEETPAGE psp[4];
58 HWND hDlg = NULL;
59 MSG Msg;
60
61 pServicePropSheet = (PSERVICEPROPSHEET)Param;
62
63 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
64 psh.dwSize = sizeof(PROPSHEETHEADER);
66 psh.hwndParent = pServicePropSheet->Info->hMainWnd;
67 psh.hInstance = hInstance;
69 psh.pszCaption = pServicePropSheet->Info->pCurrentService->lpDisplayName;
70 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
71 psh.nStartPage = 0;
72 psh.ppsp = psp;
73
74 /* Initialize the tabs */
75 InitPropSheetPage(&psp[0], pServicePropSheet, IDD_DLG_GENERAL, GeneralPageProc);
76 InitPropSheetPage(&psp[1], pServicePropSheet, IDD_LOGON, LogonPageProc);
77 InitPropSheetPage(&psp[2], pServicePropSheet, IDD_RECOVERY, RecoveryPageProc);
78 InitPropSheetPage(&psp[3], pServicePropSheet, IDD_DLG_DEPEND, DependenciesPageProc);
79
80 hDlg = (HWND)PropertySheetW(&psh);
81 if (hDlg)
82 {
83 /* Pump the message queue */
84 while (GetMessageW(&Msg, NULL, 0, 0))
85 {
87 {
88 /* The user hit the ok / cancel button, pull it down */
89 EnableWindow(pServicePropSheet->Info->hMainWnd, TRUE);
90 DestroyWindow(hDlg);
91 }
92
93 if (!PropSheet_IsDialogMessage(hDlg, &Msg))
94 {
97 }
98 }
99 }
100
101 HeapFree(GetProcessHeap(), 0, pServicePropSheet);
102
103 return (hDlg != NULL);
104}
INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK LogonPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
INT_PTR CALLBACK RecoveryPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
#define IDD_LOGON
Definition: resource.h:141
#define IDD_DLG_GENERAL
Definition: resource.h:126
#define IDI_SM_ICON
Definition: resource.h:64
#define IDD_RECOVERY
Definition: resource.h:156
#define IDD_DLG_DEPEND
Definition: resource.h:174
struct @1644 Msg[]
#define TRUE
Definition: types.h:120
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define HeapFree(x, y, z)
Definition: compat.h:735
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_MODELESS
Definition: prsht.h:50
#define PropSheet_IsDialogMessage(d, m)
Definition: prsht.h:347
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PropSheet_GetCurrentPageHwnd(d)
Definition: prsht.h:345
HWND hMainWnd
Definition: precomp.h:51
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:60
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define LoadIcon
Definition: winuser.h:5822
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by OpenPropSheet().