/********************************************************************* * CPlApplet (inetcpl.@) * * Control Panel entry point * * PARAMS * hWnd [I] Handle for the Control Panel Window * command [I] CPL_* Command * lParam1 [I] first extra Parameter * lParam2 [I] second extra Parameter * * RETURNS * Depends on the command * */ LONG CALLBACK CPlApplet(HWND hWnd, UINT command, LPARAM lParam1, LPARAM lParam2) { TRACE("(%p, %u, 0x%lx, 0x%lx)\n", hWnd, command, lParam1, lParam2); switch (command) { case CPL_INIT: return TRUE; case CPL_GETCOUNT: return 1; case CPL_INQUIRE: { CPLINFO *appletInfo = (CPLINFO *) lParam2; appletInfo->idIcon = ICO_MAIN; appletInfo->idName = IDS_CPL_NAME; appletInfo->idInfo = IDS_CPL_INFO; appletInfo->lData = 0; return TRUE; } case CPL_DBLCLK: display_cpl_sheets(hWnd); break; } return FALSE; }
/********************************************************************* * CPlApplet (joy.cpl.@) * * Control Panel entry point * * PARAMS * hWnd [I] Handle for the Control Panel Window * command [I] CPL_* Command * lParam1 [I] first extra Parameter * lParam2 [I] second extra Parameter * * RETURNS * Depends on the command * */ LONG CALLBACK CPlApplet(HWND hwnd, UINT command, LPARAM lParam1, LPARAM lParam2) { static struct JoystickData data; TRACE("(%p, %u, 0x%lx, 0x%lx)\n", hwnd, command, lParam1, lParam2); switch (command) { case CPL_INIT: { HRESULT hr; /* Initialize dinput */ hr = DirectInput8Create(GetModuleHandleW(NULL), DIRECTINPUT_VERSION, &IID_IDirectInput8W, (void**)&data.di, NULL); if (FAILED(hr)) { ERR("Failed to initialize DirectInput: 0x%08x\n", hr); return FALSE; } /* Then get all the connected joysticks */ initialize_joysticks(&data); return TRUE; } case CPL_GETCOUNT: return 1; case CPL_INQUIRE: { CPLINFO *appletInfo = (CPLINFO *) lParam2; appletInfo->idIcon = ICO_MAIN; appletInfo->idName = IDS_CPL_NAME; appletInfo->idInfo = IDS_CPL_INFO; appletInfo->lData = 0; return TRUE; } case CPL_DBLCLK: display_cpl_sheets(hwnd, &data); break; case CPL_STOP: destroy_joysticks(&data); /* And destroy dinput too */ IDirectInput8_Release(data.di); break; } return FALSE; }
/********************************************************************* * LaunchInternetControlPanel (inetcpl.@) * * Launch the Internet Control Panel dialog * * PARAMS * parent [I] Handle for the parent window * * RETURNS * Success: TRUE * * NOTES * rundll32 callable function: rundll32 inetcpl.cpl,LaunchInternetControlPanel * */ BOOL WINAPI LaunchInternetControlPanel(HWND parent) { display_cpl_sheets(parent); return TRUE; }