mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
Implemented launching of date/time control panel applet
svn path=/trunk/; revision=5879
This commit is contained in:
parent
8a964fafb7
commit
44eb89d031
4 changed files with 42 additions and 3 deletions
|
@ -9,7 +9,7 @@
|
||||||
- implement Drag Drop from the tree view.
|
- implement Drag Drop from the tree view.
|
||||||
- activate accelerator keys like <DEL> in shell view folders
|
- activate accelerator keys like <DEL> in shell view folders
|
||||||
- program manager "progman" DDE server
|
- program manager "progman" DDE server
|
||||||
- command line parameters like "/e,/root,c:\"
|
- command line parameters like "/e,/root,c:\" and "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}" (launch auf control panel)
|
||||||
- search functionality in start menu
|
- search functionality in start menu
|
||||||
- Windows-key combos
|
- Windows-key combos
|
||||||
- Application Desktop Toolbars
|
- Application Desktop Toolbars
|
||||||
|
|
|
@ -303,6 +303,12 @@ LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
Paint();
|
Paint();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_LBUTTONDBLCLK:
|
||||||
|
//launch_file(_hwnd, _T("timedate.cpl"), SW_SHOWNORMAL); // This would be enough, but we want the fastest solution.
|
||||||
|
//launch_file(_hwnd, _T("rundll32.exe /d shell32.dll,Control_RunDLL timedate.cpl"), SW_SHOWNORMAL);
|
||||||
|
RunDLL(_hwnd, _T("shell32"), "Control_RunDLL", _T("timedate.cpl"), SW_SHOWNORMAL);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return super::WndProc(nmsg, wparam, lparam);
|
return super::WndProc(nmsg, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,3 +121,33 @@ int find_window_class(LPCTSTR classname)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typedef void (WINAPI*RUNDLLPROC)(HWND hwnd, HINSTANCE hinst, LPCTSTR cmdline, DWORD nCmdShow);
|
||||||
|
|
||||||
|
BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow)
|
||||||
|
{
|
||||||
|
HMODULE hmod = LoadLibrary(dllname);
|
||||||
|
if (!hmod)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/*TODO
|
||||||
|
<Windows NT/2000>
|
||||||
|
It is possible to create a Unicode version of the function.
|
||||||
|
Rundll32 first tries to find a function named EntryPointW.
|
||||||
|
If it cannot find this function, it tries EntryPointA, then EntryPoint.
|
||||||
|
To create a DLL that supports ANSI on Windows 95/98/Me and Unicode otherwise,
|
||||||
|
export two functions: EntryPointW and EntryPoint.
|
||||||
|
*/
|
||||||
|
RUNDLLPROC proc = (RUNDLLPROC)GetProcAddress(hmod, procname);
|
||||||
|
if (!proc) {
|
||||||
|
FreeLibrary(hmod);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
proc(hwnd, hmod, cmdline, nCmdShow);
|
||||||
|
|
||||||
|
FreeLibrary(hmod);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -401,6 +401,9 @@ extern BOOL time_to_filetime(const time_t* t, FILETIME* ftime);
|
||||||
// search for windows of a specific classname
|
// search for windows of a specific classname
|
||||||
extern int find_window_class(LPCTSTR classname);
|
extern int find_window_class(LPCTSTR classname);
|
||||||
|
|
||||||
|
// create a bitmap from an icon
|
||||||
|
extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
|
||||||
|
|
||||||
// launch a program or document file
|
// launch a program or document file
|
||||||
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow);
|
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow);
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
|
@ -409,8 +412,8 @@ extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow);
|
||||||
#define launch_fileA launch_file
|
#define launch_fileA launch_file
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// create a bitmap from an icon
|
// call an DLL export like rundll32
|
||||||
extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
|
BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in a new issue