530a78d442c86a201953b56538f51facc6d6afd0
3 * Copyright (C) 2004 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * PROJECT: ReactOS Software Control Panel
22 * FILE: dll/cpl/joy/joy.c
23 * PURPOSE: ReactOS Software Control Panel
24 * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
31 #define NUM_APPLETS (1)
33 LONG CALLBACK
SystemApplet(HWND hwnd
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
);
34 HINSTANCE hApplet
= 0;
38 APPLET Applets
[NUM_APPLETS
] =
40 {IDI_CPLSYSTEM
, IDS_CPLSYSTEMNAME
, IDS_CPLSYSTEMDESCRIPTION
, SystemApplet
}
44 AddColumns(HWND hList
)
51 GetClientRect(hList
, &rect
);
52 Size
= rect
.right
- rect
.left
- 250;
54 LoadString(hApplet
, IDS_STATUS
, szBuf
, sizeof(szBuf
) / sizeof(TCHAR
));
56 ZeroMemory(&dummy
, sizeof(LV_COLUMN
));
57 dummy
.mask
= LVCF_TEXT
| LVCF_WIDTH
| LVCF_SUBITEM
;
59 dummy
.pszText
= (LPTSTR
)szBuf
;
61 (void)ListView_InsertColumn(hList
, 0, &dummy
);
63 GetClientRect(hList
, &rect
);
65 LoadString(hApplet
, IDS_CONTROLLER
, szBuf
, sizeof(szBuf
) / sizeof(TCHAR
));
67 ZeroMemory(&dummy
, sizeof(LV_COLUMN
));
68 dummy
.mask
= LVCF_TEXT
| LVCF_WIDTH
| LVCF_SUBITEM
;
70 dummy
.pszText
= (LPTSTR
)szBuf
;
71 dummy
.cx
= rect
.right
- rect
.left
- Size
;
72 (void)ListView_InsertColumn(hList
, 0, &dummy
);
76 AdvancedPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
78 UNREFERENCED_PARAMETER(lParam
);
86 switch (LOWORD(wParam
))
89 EndDialog(hwndDlg
,LOWORD(wParam
));
93 EndDialog(hwndDlg
,LOWORD(wParam
));
102 switch (LOWORD(wParam
))
105 // Not implemented yet
114 CustomPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
116 UNREFERENCED_PARAMETER(lParam
);
124 switch (LOWORD(wParam
))
127 EndDialog(hwndDlg
,LOWORD(wParam
));
131 EndDialog(hwndDlg
,LOWORD(wParam
));
140 switch (LOWORD(wParam
))
143 // Not implemented yet
152 AddPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
154 UNREFERENCED_PARAMETER(lParam
);
162 switch (LOWORD(wParam
))
164 case IDC_CUSTOM_BUTTON
:
166 MAKEINTRESOURCE(IDD_CUSTOM
),
172 EndDialog(hwndDlg
,LOWORD(wParam
));
176 EndDialog(hwndDlg
,LOWORD(wParam
));
185 switch (LOWORD(wParam
))
188 // Not implemented yet
196 /* Property page dialog callback */
198 MainPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
200 static HICON s_hIcon
= NULL
, s_hIconSm
= NULL
;
201 UNREFERENCED_PARAMETER(lParam
);
206 AddColumns(GetDlgItem(hwndDlg
,IDC_CONTROLLER_LIST
));
207 s_hIcon
= LoadIconW(hApplet
, MAKEINTRESOURCEW(IDI_CPLSYSTEM
));
208 s_hIconSm
= (HICON
)LoadImageW(hApplet
, MAKEINTRESOURCEW(IDI_CPLSYSTEM
),
210 GetSystemMetrics(SM_CXSMICON
),
211 GetSystemMetrics(SM_CYSMICON
), 0);
212 SendMessageW(hwndDlg
, WM_SETICON
, ICON_BIG
, (LPARAM
)s_hIcon
);
213 SendMessageW(hwndDlg
, WM_SETICON
, ICON_SMALL
, (LPARAM
)s_hIconSm
);
217 switch (LOWORD(wParam
))
221 MAKEINTRESOURCE(IDD_ADD
),
226 case IDC_ADVANCED_BUTTON
:
228 MAKEINTRESOURCE(IDD_ADVANCED
),
234 DestroyIcon(s_hIcon
);
235 DestroyIcon(s_hIconSm
);
236 EndDialog(hwndDlg
,LOWORD(wParam
));
245 switch (LOWORD(wParam
))
248 DestroyIcon(s_hIcon
);
249 DestroyIcon(s_hIconSm
);
250 EndDialog(hwndDlg
,LOWORD(wParam
));
254 // Not implemented yet
264 SystemApplet(HWND hwnd
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
266 UNREFERENCED_PARAMETER(uMsg
);
267 UNREFERENCED_PARAMETER(lParam1
);
268 UNREFERENCED_PARAMETER(lParam2
);
271 MAKEINTRESOURCE(IDD_PROPPAGEMAIN
),
278 /* Control Panel Callback */
280 CPlApplet(HWND hwndCPl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
285 UNREFERENCED_PARAMETER(hwndCPl
);
297 CPlInfo
= (CPLINFO
*)lParam2
;
299 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
300 CPlInfo
->idName
= Applets
[i
].idName
;
301 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
305 Applets
[i
].AppletProc(hwndCPl
, uMsg
, lParam1
, lParam2
);
313 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
315 UNREFERENCED_PARAMETER(lpvReserved
);
319 case DLL_PROCESS_ATTACH
:
320 case DLL_THREAD_ATTACH
: