2004-06-18 20:43:44 +00:00
|
|
|
/*
|
2009-08-15 11:14:07 +00:00
|
|
|
* PROJECT: ReactOS Software Control Panel
|
|
|
|
* FILE: dll/cpl/appwiz/appwiz.c
|
|
|
|
* PURPOSE: ReactOS Software Control Panel
|
|
|
|
* PROGRAMMERS: Gero Kuehn (reactos.filter@gkware.com)
|
|
|
|
* Dmitry Chapyshev (dmitry@reactos.org)
|
2004-06-18 20:43:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "appwiz.h"
|
|
|
|
|
2014-01-19 10:17:54 +00:00
|
|
|
#include <shellapi.h>
|
|
|
|
#include <cpl.h>
|
|
|
|
#include <wine/unicode.h>
|
2013-05-19 21:21:20 +00:00
|
|
|
|
2009-08-15 11:14:07 +00:00
|
|
|
HINSTANCE hApplet = NULL;
|
2004-06-30 12:11:11 +00:00
|
|
|
|
2014-10-30 20:50:30 +00:00
|
|
|
static LONG start_params(const WCHAR *params, HWND hwnd_parent)
|
2013-05-19 21:21:20 +00:00
|
|
|
{
|
2023-05-11 04:01:02 +00:00
|
|
|
if (!params)
|
2013-05-19 21:21:20 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2023-05-11 04:01:02 +00:00
|
|
|
if (!strcmpW(params, L"install_gecko"))
|
|
|
|
{
|
2014-10-30 20:50:30 +00:00
|
|
|
install_addon(ADDON_GECKO, hwnd_parent);
|
2013-05-19 21:21:20 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2023-05-11 04:01:02 +00:00
|
|
|
if (!strcmpW(params, L"install_mono"))
|
|
|
|
{
|
2014-10-30 20:50:30 +00:00
|
|
|
install_addon(ADDON_MONO, hwnd_parent);
|
2013-05-19 21:21:20 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("unknown param %s\n", debugstr_w(params));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2004-06-18 20:43:44 +00:00
|
|
|
/* Control Panel Callback */
|
2004-06-30 12:11:11 +00:00
|
|
|
LONG CALLBACK
|
|
|
|
CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
2004-06-18 20:43:44 +00:00
|
|
|
{
|
2007-09-16 13:38:26 +00:00
|
|
|
CPLINFO *CPlInfo;
|
|
|
|
|
|
|
|
switch (uMsg)
|
|
|
|
{
|
|
|
|
case CPL_INIT:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case CPL_GETCOUNT:
|
2009-08-15 11:14:07 +00:00
|
|
|
return 1;
|
2007-09-16 13:38:26 +00:00
|
|
|
|
2013-05-19 21:21:20 +00:00
|
|
|
case CPL_STARTWPARMSW:
|
2014-10-30 20:50:30 +00:00
|
|
|
return start_params((const WCHAR *)lParam2, hwndCPl);
|
2013-05-19 21:21:20 +00:00
|
|
|
|
2007-09-16 13:38:26 +00:00
|
|
|
case CPL_INQUIRE:
|
|
|
|
CPlInfo = (CPLINFO*)lParam2;
|
|
|
|
CPlInfo->lData = 0;
|
2009-08-15 11:14:07 +00:00
|
|
|
CPlInfo->idIcon = IDI_CPLSYSTEM;
|
|
|
|
CPlInfo->idName = IDS_CPLSYSTEMNAME;
|
|
|
|
CPlInfo->idInfo = IDS_CPLSYSTEMDESCRIPTION;
|
2007-09-16 13:38:26 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CPL_DBLCLK:
|
2013-05-19 21:21:20 +00:00
|
|
|
ShellExecuteW(NULL,
|
|
|
|
NULL,
|
|
|
|
L"rapps.exe",
|
2023-05-21 22:50:32 +00:00
|
|
|
L"/appwiz",
|
2013-05-19 21:21:20 +00:00
|
|
|
NULL,
|
2023-05-21 22:50:32 +00:00
|
|
|
SW_SHOWNORMAL);
|
2007-09-16 13:38:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2004-06-18 20:43:44 +00:00
|
|
|
}
|
|
|
|
|
2004-06-30 12:11:11 +00:00
|
|
|
BOOL WINAPI
|
|
|
|
DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
2004-06-18 20:43:44 +00:00
|
|
|
{
|
2007-09-16 13:38:26 +00:00
|
|
|
UNREFERENCED_PARAMETER(lpvReserved);
|
|
|
|
|
|
|
|
switch (dwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
case DLL_THREAD_ATTACH:
|
2007-10-04 23:51:10 +00:00
|
|
|
CoInitialize(NULL);
|
2007-09-16 13:38:26 +00:00
|
|
|
hApplet = hinstDLL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2004-06-18 20:43:44 +00:00
|
|
|
}
|