- Implement the code for the "Run" and "Shutdown" menu items, create stubs for the...
authorColin Finck <colin@reactos.org>
Sat, 14 Jun 2008 21:18:08 +0000 (21:18 +0000)
committerColin Finck <colin@reactos.org>
Sat, 14 Jun 2008 21:18:08 +0000 (21:18 +0000)
- Replace the ROS-specific STDCALL by APIENTRY for the function prototypes

svn path=/trunk/; revision=33966

reactos/base/shell/explorer-new/precomp.h
reactos/base/shell/explorer-new/traywnd.c

index bf8fc0e..b33485a 100644 (file)
 #include "undoc.h"
 
 /* dynamic imports due to lack of support in msvc linker libs */
-typedef INT (STDCALL *REGSHELLHOOK)(HWND, DWORD);
+typedef INT (APIENTRY *REGSHELLHOOK)(HWND, DWORD);
 #ifdef UNICODE
 #define PROC_NAME_DRAWCAPTIONTEMP "DrawCaptionTempW"
-typedef BOOL (STDCALL *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCWSTR, UINT);
+typedef BOOL (APIENTRY *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCWSTR, UINT);
 #else
 #define PROC_NAME_DRAWCAPTIONTEMP "DrawCaptionTempA"
-typedef BOOL (STDCALL *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCSTR, UINT);
+typedef BOOL (APIENTRY *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCSTR, UINT);
 #endif
-typedef HRESULT (STDCALL *SHINVDEFCMD)(HWND, IShellFolder*, LPCITEMIDLIST);
+typedef HRESULT (APIENTRY *SHINVDEFCMD)(HWND, IShellFolder*, LPCITEMIDLIST);
+typedef void (APIENTRY *RUNFILEDLG)(HWND, HICON, LPCWSTR, LPCWSTR, LPCWSTR, UINT);
+typedef void (APIENTRY *EXITWINDLG)(HWND);
+typedef HRESULT (APIENTRY *SHWINHELP)(HWND, LPWSTR, UINT, DWORD);
+
+/* Constants for RunFileDlg */
+#define RFF_CALCDIRECTORY   0x04    /* Calculates the working directory from the file name. */
 
 static ULONG __inline
 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
index 1f9451d..e42e61f 100644 (file)
@@ -2260,7 +2260,45 @@ HandleTrayContextMenu:
                                                             lParam,
                                                             &Ret)))
                 {
-                    /* FIXME: Handle own commands */
+                    switch(LOWORD(wParam))
+                    {
+                        /* FIXME: Handle these commands as well */
+                        case IDM_TASKBARANDSTARTMENU:
+                        case IDM_SEARCH:
+                        case IDM_HELPANDSUPPORT:
+                            break;
+
+                        case IDM_RUN:
+                        {
+                            HANDLE hShell32;
+                            RUNFILEDLG RunFileDlg;
+
+                            hShell32 = GetModuleHandle(TEXT("SHELL32.DLL"));
+                            RunFileDlg = (RUNFILEDLG)GetProcAddress(hShell32, (LPCSTR)61);
+
+                            RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
+                            break;
+                        }
+
+                        /* FIXME: Handle these commands as well */
+                        case IDM_SYNCHRONIZE:
+                        case IDM_LOGOFF:
+                        case IDM_DISCONNECT:
+                        case IDM_UNDOCKCOMPUTER:
+                            break;
+
+                        case IDM_SHUTDOWN:
+                        {
+                            HANDLE hShell32;
+                            EXITWINDLG ExitWinDlg;
+
+                            hShell32 = GetModuleHandle(TEXT("SHELL32.DLL"));
+                            ExitWinDlg = (EXITWINDLG)GetProcAddress(hShell32, (LPCSTR)60);
+
+                            ExitWinDlg(hwnd);
+                            break;
+                        }
+                    }
                 }
                 break;