<library>gdi32</library>
<library>user32</library>
<library>comctl32</library>
- <library>msvcrt20</library>
- <library>ntdll</library>
<library>ole32</library>
<library>oleaut32</library>
- <library>shdocvw</library>
<library>shell32</library>
<library>shlwapi</library>
<library>uuid</library>
#include "todo.h"
#include "undoc.h"
+/* dynamic imports due to lack of support in msvc linker libs */
+typedef INT (STDCALL *REGSHELLHOOK)(HWND, DWORD);
+typedef BOOL (STDCALL *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCWSTR, UINT);
+
static ULONG __inline
Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
{
/*
* desktop.c
*/
-
-#define SHCNRF_InterruptLevel (0x0001)
-#define SHCNRF_ShellLevel (0x0002)
-#define SHCNRF_RecursiveInterrupt (0x1000)
-#define SHCNRF_NewDelivery (0x8000)
-
-
HANDLE
DesktopCreateWindow(IN OUT ITrayWindow *Tray);
if (This->hWndToolbar != NULL)
{
+ HMODULE hShell32;
SIZE BtnSize;
/* Identify the version we're using */
/* Register the shell hook */
This->ShellHookMsg = RegisterWindowMessage(TEXT("SHELLHOOK"));
- RegisterShellHook(This->hWnd,
- 3); /* 1 if not NT! We're targeting NT so we don't care! */
+ hShell32 = LoadLibrary(TEXT("SHELL32.DLL"));
+ if (hShell32 != NULL)
+ {
+ REGSHELLHOOK RegShellHook;
+
+ /* RegisterShellHook */
+ RegShellHook = (REGSHELLHOOK)GetProcAddress(hShell32,
+ (LPCSTR)((LONG)181));
+ if (RegShellHook != NULL)
+ {
+ RegShellHook(This->hWnd,
+ 3); /* 1 if no NT! We're targeting NT so we don't care! */
+ }
+
+ FreeLibrary(hShell32);
+ }
/* Add all windows to the toolbar */
EnumWindows(TaskSwitchWnd_EnumWindowsProc,
static VOID
TaskSwitchWnd_NCDestroy(IN OUT PTASK_SWITCH_WND This)
{
+ HMODULE hShell32;
+
This->IsDestroying = TRUE;
/* Unregister the shell hook */
- RegisterShellHook(This->hWnd,
- FALSE);
+ hShell32 = LoadLibrary(TEXT("SHELL32.DLL"));
+ if (hShell32 != NULL)
+ {
+ REGSHELLHOOK RegShellHook;
+
+ /* RegisterShellHook */
+ RegShellHook = (REGSHELLHOOK)GetProcAddress(hShell32,
+ (LPCSTR)((LONG)181));
+ if (RegShellHook != NULL)
+ {
+ RegShellHook(This->hWnd,
+ FALSE);
+ }
+
+ FreeLibrary(hShell32);
+ }
TaskSwitchWnd_DeleteAllTasks(This);
}
{
HFONT hCaptionFont, hBoldCaptionFont;
LRESULT Ret = CDRF_DODEFAULT;
+ HMODULE hUser32;
#if TASK_USE_DRAWCAPTIONTEMP != 0
uidctFlags |= DC_ACTIVE;
}
- /* Draw the button content */
- TaskItem->DisplayTooltip = !DrawCaptionTemp(TaskItem->hWnd,
- nmtbcd->nmcd.hdc,
- &nmtbcd->nmcd.rc,
- hCaptionFont,
- NULL,
- NULL,
- uidctFlags);
+ hUser32 = LoadLibrary(TEXT("USER32.DLL"));
+ if (hUser32 != NULL)
+ {
+ DRAWCAPTEMP DrawCapTemp;
+ LONG ord = 187;
+#ifndef UNICODE
+ ord = 186;
+#endif
+ /* DrawCaptionTemp */
+ DrawCapTemp = (DRAWCAPTEMP)GetProcAddress(hUser32,
+ (LPCSTR)ord);
+ if (DrawCapTemp != NULL)
+ {
+ /* Draw the button content */
+ TaskItem->DisplayTooltip = !DrawCapTemp(TaskItem->hWnd,
+ nmtbcd->nmcd.hdc,
+ &nmtbcd->nmcd.rc,
+ hCaptionFont,
+ NULL,
+ NULL,
+ uidctFlags);
+ }
+
+ FreeLibrary(hUser32);
+ }
return CDRF_SKIPDEFAULT;
#ifndef __TODO_H
#define __TODO_H
-/*
- * Stuff missing in our headers
- */
-
-#define SM_REMOTECONTROL 0x2001
-
/* FIXME: Ugly hack!!! FIX ASAP! Move to uuid! */
static const GUID IID_HACK_IShellView2 = {0x88E39E80,0x3578,0x11CF,{0xAE,0x69,0x08,0x00,0x2B,0x2E,0x12,0x62}};
#define IID_IShellView2 IID_HACK_IShellView2
#define IDeskBarClient_GetSize(T,a,b) (T)->lpVtbl->GetSize(T,a,b)
#endif
-
-#define SHGVSPB_PERUSER 0x1
-#define SHGVSPB_PERFOLDER 0x4
-#define SHGVSPB_ROAM 0x00000020
-#define SHGVSPB_NOAUTODEFAULTS 0x80000000
-#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
-#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS)
-
-
-#define DBC_SHOW 1
-#define DBC_HIDE 0
-
static const GUID IID_HACK_IShellService = {0x5836FB00,0x8187,0x11CF,{0xA1,0x2B,0x00,0xAA,0x00,0x4A,0xE8,0x37}};
#define IID_IShellService IID_HACK_IShellService
#define IShellService_SetOwner(T,a) (T)->lpVtbl->SetOwner(T,a)
#endif
-#if _MSC_VER
-HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST,LPCWSTR,DWORD,REFIID,PVOID*);/* FIXME: Parameter should be PCIDLIST_ABSOLUTE */
-#else
-typedef HRESULT (WINAPI *PSHGetViewStatePropertyBag)(LPCITEMIDLIST,LPCWSTR,DWORD,REFIID,PVOID*);
-static HRESULT __inline
-SHGetViewStatePropertyBag(IN LPCITEMIDLIST pidl,
- IN LPCWSTR pszBagName,
- IN DWORD dwFlags,
- IN REFIID riid,
- OUT PVOID* ppv)
-{
- static PSHGetViewStatePropertyBag Func = NULL;
-
- if (Func == NULL)
- {
- HMODULE hShlwapi;
- hShlwapi = LoadLibrary(TEXT("SHLWAPI.DLL"));
- if (hShlwapi != NULL)
- {
- Func = (PSHGetViewStatePropertyBag)GetProcAddress(hShlwapi, "SHGetViewStatePropertyBag");
- }
- }
-
- if (Func != NULL)
- {
- return Func(pidl, pszBagName, dwFlags, riid, ppv);
- }
-
- MessageBox(NULL, TEXT("SHGetViewStatePropertyBag not available"), NULL, 0);
- return E_NOTIMPL;
-}
-#endif
-
-#define PIDLIST_ABSOLUTE LPITEMIDLIST
-PIDLIST_ABSOLUTE WINAPI SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
-
#endif /* __TODO_H */
BOOL Ret;
UINT Flags;
RECT rcButton;
+ HMODULE hUser32;
/* NOTE: This is the backwards compatibility code that is used if the
Common Controls Version 6.0 are not available! */
if (hIconStart != NULL)
Flags |= DC_ICON;
- Ret = DrawCaptionTemp(NULL,
- hDC,
- &rcButton,
- This->hStartBtnFont,
- hIconStart,
- szStartCaption,
- Flags);
+ hUser32 = LoadLibrary(TEXT("USER32.DLL"));
+ if (hUser32 != NULL)
+ {
+ DRAWCAPTEMP DrawCapTemp;
+ LONG ord = 187;
+#ifndef UNICODE
+ ord = 186;
+#endif
+ /* DrawCaptionTemp */
+ DrawCapTemp = (DRAWCAPTEMP)GetProcAddress(hUser32,
+ (LPCSTR)ord);
+ if (DrawCapTemp != NULL)
+ {
+ Ret = DrawCapTemp(NULL,
+ hDC,
+ &rcButton,
+ This->hStartBtnFont,
+ hIconStart,
+ szStartCaption,
+ Flags);
+ }
+
+ FreeLibrary(hUser32);
+ }
SelectObject(hDC,
hbmpOld);
};
#undef INTERFACE
+#define DBC_GS_IDEAL 0
+#define DBC_GS_SIZEDOWN 1
+
+#define DBC_HIDE 0
+#define DBC_SHOW 1
+#define DBC_SHOWOBSCURE 2
+
/****************************************************************************
* SHAddToRecentDocs API
HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
#define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
+PIDLIST_ABSOLUTE WINAPI SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate);
BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate);
#define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
HRESULT WINAPI DllInstall(BOOL,LPCWSTR) DECLSPEC_HIDDEN;
+#if (_WIN32_IE >= 0x0600)
+#define SHGVSPB_PERUSER 0x00000001
+#define SHGVSPB_ALLUSERS 0x00000002
+#define SHGVSPB_PERFOLDER 0x00000004
+#define SHGVSPB_ALLFOLDERS 0x00000008
+#define SHGVSPB_INHERIT 0x00000010
+#define SHGVSPB_ROAM 0x00000020
+#define SHGVSPB_NOAUTODEFAULTS 0x80000000
+
+#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
+#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS)
+#define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS)
+#define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS)
+
+HRESULT WINAPI SHGetViewStatePropertyBag(PCIDLIST_ABSOLUTE pidl, LPCWSTR pszBagName, DWORD dwFlags, REFIID riid, void** ppv);
+#endif /* (_WIN32_IE >= 0x0600) */
+
+
/* IsOS definitions */
#define OS_WIN32SORGREATER 0x00
#define SM_CXFOCUSBORDER 83
#define SM_CYFOCUSBORDER 84
#define SM_SHUTTINGDOWN 0x2000
+#define SM_REMOTECONTROL 0x2001
#endif /* _WIN32_WINNT >= 0x0501 */
#define SM_REMOTESESSION 0X1000
#define ARW_BOTTOMLEFT 0