[ADVAPI32_WINETEST] Revert service.c changes from 3c1b7834e1 to avoid testbot hangs...
[reactos.git] / modules / rostests / winetests / GUI / optionswnd.c
1 /*
2 * PROJECT: ReactOS API Test GUI
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE:
5 * PURPOSE: options dialog implementation
6 * COPYRIGHT: Copyright 2008 Ged Murphy <gedmurphy@reactos.org>
7 *
8 */
9
10 #include <precomp.h>
11
12 static BOOL
13 OnInitBrowseDialog(HWND hDlg,
14 LPARAM lParam)
15 {
16 PMAIN_WND_INFO pInfo;
17
18 pInfo = (PMAIN_WND_INFO)lParam;
19
20 pInfo->hBrowseDlg = hDlg;
21
22 SetWindowLongPtr(hDlg,
23 GWLP_USERDATA,
24 (LONG_PTR)pInfo);
25
26 return TRUE;
27 }
28
29
30 BOOL CALLBACK
31 OptionsDlgProc(HWND hDlg,
32 UINT Message,
33 WPARAM wParam,
34 LPARAM lParam)
35 {
36 PMAIN_WND_INFO pInfo;
37
38 //UNREFERENCED_PARAM(
39
40 /* Get the window context */
41 pInfo = (PMAIN_WND_INFO)GetWindowLongPtr(hDlg,
42 GWLP_USERDATA);
43 if (pInfo == NULL && Message != WM_INITDIALOG)
44 {
45 goto HandleDefaultMessage;
46 }
47
48 switch(Message)
49 {
50 case WM_INITDIALOG:
51 return OnInitBrowseDialog(hDlg, lParam);
52
53 case WM_COMMAND:
54 {
55 switch (LOWORD(wParam))
56 {
57 case IDOK:
58 {
59 if (SendMessageW(GetDlgItem(hDlg, IDC_RUNONSTART), BM_GETCHECK, 0, 0) == BST_CHECKED)
60 {
61 pInfo->bRunOnStart = TRUE;
62 }
63 else
64 {
65 pInfo->bRunOnStart = FALSE;
66 }
67
68 if (SendMessageW(GetDlgItem(hDlg, IDC_HIDECONSOLE), BM_GETCHECK, 0, 0) == BST_CHECKED)
69 {
70 pInfo->bHideConsole = TRUE;
71 }
72 else
73 {
74 pInfo->bHideConsole = FALSE;
75 }
76
77 EndDialog(hDlg,
78 LOWORD(wParam));
79
80 return TRUE;
81 }
82
83 case IDCANCEL:
84 {
85 EndDialog(hDlg,
86 LOWORD(wParam));
87
88 return TRUE;
89 }
90 }
91
92 break;
93 }
94 HandleDefaultMessage:
95 default:
96 return FALSE;
97 }
98
99 return FALSE;
100 }