Implemented launching of date/time control panel applet
authorMartin Fuchs <fuchs.martin@gmail.com>
Wed, 27 Aug 2003 10:00:26 +0000 (10:00 +0000)
committerMartin Fuchs <fuchs.martin@gmail.com>
Wed, 27 Aug 2003 10:00:26 +0000 (10:00 +0000)
svn path=/trunk/; revision=5879

reactos/subsys/system/explorer/doc/TODO.txt
reactos/subsys/system/explorer/taskbar/traynotify.cpp
reactos/subsys/system/explorer/utility/utility.cpp
reactos/subsys/system/explorer/utility/utility.h

index 0855f54..192b6ba 100644 (file)
@@ -9,7 +9,7 @@
 - implement Drag Drop from the tree view.
 - activate accelerator keys like <DEL> in shell view folders
 - 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
 - Windows-key combos
 - Application Desktop Toolbars
index fb84670..175a684 100644 (file)
@@ -303,6 +303,12 @@ LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
                Paint();
                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:
                return super::WndProc(nmsg, wparam, lparam);
        }
index 4cf5d6e..e9925e5 100644 (file)
@@ -121,3 +121,33 @@ int find_window_class(LPCTSTR classname)
 
        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;
+}
index f56fc81..6815091 100644 (file)
@@ -401,6 +401,9 @@ extern BOOL time_to_filetime(const time_t* t, FILETIME* ftime);
  // search for windows of a specific 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
 extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow);
 #ifdef UNICODE
@@ -409,8 +412,8 @@ extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow);
 #define        launch_fileA launch_file
 #endif
 
- // create a bitmap from an icon
-extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
+ // call an DLL export like rundll32
+BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow);
 
 
 #ifdef __cplusplus