1 /*
2  * PROJECT:     ReactOS Applications
3  * LICENSE:     LGPL - See COPYING in the top level directory
4  * FILE:        base/applications/msconfig/generalpage.c
5  * PURPOSE:     General page message handler
6  * COPYRIGHT:   Copyright 2005-2006 Christoph von Wittich <Christoph@ApiViewer.de>
7  *
8  */
9 
10 #include "precomp.h"
11 
12 HWND hGeneralPage;
13 HWND hGeneralDialog;
14 
15 VOID
EnableCheckboxControls(HWND hDlg,BOOL bEnable)16 EnableCheckboxControls(HWND hDlg, BOOL bEnable)
17 {
18     EnableWindow(GetDlgItem(hDlg, IDC_CBX_SYSTEM_INI), bEnable);
19     EnableWindow(GetDlgItem(hDlg, IDC_CBX_SYSTEM_SERVICE), bEnable);
20     EnableWindow(GetDlgItem(hDlg, IDC_CBX_STARTUP_ITEM), bEnable);
21 }
22 
23 
24 INT_PTR CALLBACK
GeneralPageWndProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)25 GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
26 {
27     UNREFERENCED_PARAMETER(lParam);
28 
29     switch (message)
30     {
31     case WM_INITDIALOG:
32         hGeneralDialog = hDlg;
33         SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
34         /* FIXME */
35         SendDlgItemMessage(hDlg, IDC_CBX_NORMAL_START, BM_SETCHECK, BST_CHECKED, 0);
36         EnableCheckboxControls(hDlg, FALSE);
37         return TRUE;
38     case WM_COMMAND:
39         switch(LOWORD(wParam))
40         {
41             case IDC_CBX_NORMAL_START:
42             case IDC_CBX_DIAGNOSTIC_START:
43                 EnableCheckboxControls(hDlg, FALSE);
44                 break;
45             case IDC_CBX_SELECTIVE_STARTUP:
46                 EnableCheckboxControls(hDlg, TRUE);
47                 break;
48             default:
49                 break;
50         }
51     }
52     return 0;
53 }
54