Author: cfinck Date: Sat Jun 14 16:18:08 2008 New Revision: 33966
URL: http://svn.reactos.org/svn/reactos?rev=33966&view=rev Log: - Implement the code for the "Run" and "Shutdown" menu items, create stubs for the other custom commands - Replace the ROS-specific STDCALL by APIENTRY for the function prototypes
Modified: trunk/reactos/base/shell/explorer-new/precomp.h trunk/reactos/base/shell/explorer-new/traywnd.c
Modified: trunk/reactos/base/shell/explorer-new/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/pre... ============================================================================== --- trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] Sat Jun 14 16:18:08 2008 @@ -25,15 +25,21 @@ #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, ...)
Modified: trunk/reactos/base/shell/explorer-new/traywnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Sat Jun 14 16:18:08 2008 @@ -2260,7 +2260,45 @@ 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;