1c2c66affSColin Finck /*
2c2c66affSColin Finck * PROJECT: ReactOS Software Control Panel
3c2c66affSColin Finck * FILE: dll/cpl/appwiz/appwiz.c
4c2c66affSColin Finck * PURPOSE: ReactOS Software Control Panel
5c2c66affSColin Finck * PROGRAMMERS: Gero Kuehn (reactos.filter@gkware.com)
6c2c66affSColin Finck * Dmitry Chapyshev (dmitry@reactos.org)
7c2c66affSColin Finck */
8c2c66affSColin Finck
9c2c66affSColin Finck #include "appwiz.h"
10c2c66affSColin Finck
11c2c66affSColin Finck #include <shellapi.h>
12c2c66affSColin Finck #include <cpl.h>
13c2c66affSColin Finck #include <wine/unicode.h>
14c2c66affSColin Finck
15c2c66affSColin Finck HINSTANCE hApplet = NULL;
16c2c66affSColin Finck
start_params(const WCHAR * params,HWND hwnd_parent)17c2c66affSColin Finck static LONG start_params(const WCHAR *params, HWND hwnd_parent)
18c2c66affSColin Finck {
19c2c66affSColin Finck if (!params)
20c2c66affSColin Finck return FALSE;
21c2c66affSColin Finck
221e5e184cSKatayama Hirofumi MZ if (!strcmpW(params, L"install_gecko"))
231e5e184cSKatayama Hirofumi MZ {
24c2c66affSColin Finck install_addon(ADDON_GECKO, hwnd_parent);
25c2c66affSColin Finck return TRUE;
26c2c66affSColin Finck }
27c2c66affSColin Finck
281e5e184cSKatayama Hirofumi MZ if (!strcmpW(params, L"install_mono"))
291e5e184cSKatayama Hirofumi MZ {
30c2c66affSColin Finck install_addon(ADDON_MONO, hwnd_parent);
31c2c66affSColin Finck return TRUE;
32c2c66affSColin Finck }
33c2c66affSColin Finck
34c2c66affSColin Finck WARN("unknown param %s\n", debugstr_w(params));
35c2c66affSColin Finck return FALSE;
36c2c66affSColin Finck }
37c2c66affSColin Finck
38c2c66affSColin Finck /* Control Panel Callback */
39c2c66affSColin Finck LONG CALLBACK
CPlApplet(HWND hwndCPl,UINT uMsg,LPARAM lParam1,LPARAM lParam2)40c2c66affSColin Finck CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
41c2c66affSColin Finck {
42c2c66affSColin Finck CPLINFO *CPlInfo;
43c2c66affSColin Finck
44c2c66affSColin Finck switch (uMsg)
45c2c66affSColin Finck {
46c2c66affSColin Finck case CPL_INIT:
47c2c66affSColin Finck return TRUE;
48c2c66affSColin Finck
49c2c66affSColin Finck case CPL_GETCOUNT:
50c2c66affSColin Finck return 1;
51c2c66affSColin Finck
52c2c66affSColin Finck case CPL_STARTWPARMSW:
53c2c66affSColin Finck return start_params((const WCHAR *)lParam2, hwndCPl);
54c2c66affSColin Finck
55c2c66affSColin Finck case CPL_INQUIRE:
56c2c66affSColin Finck CPlInfo = (CPLINFO*)lParam2;
57c2c66affSColin Finck CPlInfo->lData = 0;
58c2c66affSColin Finck CPlInfo->idIcon = IDI_CPLSYSTEM;
59c2c66affSColin Finck CPlInfo->idName = IDS_CPLSYSTEMNAME;
60c2c66affSColin Finck CPlInfo->idInfo = IDS_CPLSYSTEMDESCRIPTION;
61c2c66affSColin Finck break;
62c2c66affSColin Finck
63c2c66affSColin Finck case CPL_DBLCLK:
64c2c66affSColin Finck ShellExecuteW(NULL,
65c2c66affSColin Finck NULL,
66c2c66affSColin Finck L"rapps.exe",
67*b29e82d0SStanislav Motylkov L"/appwiz",
68c2c66affSColin Finck NULL,
69*b29e82d0SStanislav Motylkov SW_SHOWNORMAL);
70c2c66affSColin Finck break;
71c2c66affSColin Finck }
72c2c66affSColin Finck
73c2c66affSColin Finck return FALSE;
74c2c66affSColin Finck }
75c2c66affSColin Finck
76c2c66affSColin Finck BOOL WINAPI
DllMain(HINSTANCE hinstDLL,DWORD dwReason,LPVOID lpvReserved)77c2c66affSColin Finck DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
78c2c66affSColin Finck {
79c2c66affSColin Finck UNREFERENCED_PARAMETER(lpvReserved);
80c2c66affSColin Finck
81c2c66affSColin Finck switch (dwReason)
82c2c66affSColin Finck {
83c2c66affSColin Finck case DLL_PROCESS_ATTACH:
84c2c66affSColin Finck case DLL_THREAD_ATTACH:
85c2c66affSColin Finck CoInitialize(NULL);
86c2c66affSColin Finck hApplet = hinstDLL;
87c2c66affSColin Finck break;
88c2c66affSColin Finck }
89c2c66affSColin Finck
90c2c66affSColin Finck return TRUE;
91c2c66affSColin Finck }
92