4 * Copyright 2014 Giannis Adamopoulos
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 static HINSTANCE hRShell
= NULL
;
25 typedef HRESULT(WINAPI
* PSTARTMENU_CONSTRUCTOR
)(REFIID riid
, void **ppv
);
27 HRESULT WINAPI
_CStartMenu_Constructor(REFIID riid
, void **ppv
)
31 hRShell
= LoadLibraryW(L
"rshell.dll");
36 PSTARTMENU_CONSTRUCTOR func
= (PSTARTMENU_CONSTRUCTOR
)GetProcAddress(hRShell
, "CStartMenu_Constructor");
39 return func(riid
, ppv
);
43 return CoCreateInstance(CLSID_StartMenu
,
50 typedef HANDLE(WINAPI
* PSHCREATEDESKTOP
)(IShellDesktopTray
*ShellDesk
);
52 HANDLE WINAPI
_SHCreateDesktop(IShellDesktopTray
*ShellDesk
)
58 hRShell
= LoadLibraryW(L
"rshell.dll");
63 PSHCREATEDESKTOP func
= (PSHCREATEDESKTOP
)GetProcAddress(hRShell
, "SHCreateDesktop");
66 return func(ShellDesk
);
70 hFallback
= GetModuleHandleW(L
"shell32.dll");
74 PSHCREATEDESKTOP func
= (PSHCREATEDESKTOP
) GetProcAddress(hFallback
, (LPCSTR
) 200);
77 return func(ShellDesk
);
84 typedef BOOL(WINAPI
*PSHDESKTOPMESSAGELOOP
)(HANDLE hDesktop
);
86 BOOL WINAPI
_SHDesktopMessageLoop(HANDLE hDesktop
)
92 hRShell
= LoadLibraryW(L
"rshell.dll");
97 PSHDESKTOPMESSAGELOOP func
= (PSHDESKTOPMESSAGELOOP
)GetProcAddress(hRShell
, "SHDesktopMessageLoop");
100 return func(hDesktop
);
104 hFallback
= GetModuleHandleW(L
"shell32.dll");
108 PSHDESKTOPMESSAGELOOP func
= (PSHDESKTOPMESSAGELOOP
) GetProcAddress(hFallback
, (LPCSTR
) 201);
111 return func(hDesktop
);
118 typedef DWORD(WINAPI
* PWINLIST_INIT
)(void);
120 DWORD WINAPI
_WinList_Init(void)
126 hRShell
= LoadLibraryW(L
"rshell.dll");
131 PWINLIST_INIT func
= (PWINLIST_INIT
)GetProcAddress(hRShell
, "WinList_Init");
138 hFallback
= GetModuleHandleW(L
"shdocvw.dll");
142 PWINLIST_INIT func
= (PWINLIST_INIT
) GetProcAddress(hFallback
, (LPCSTR
) 110);
152 typedef void (WINAPI
*PSHELLDDEINIT
)(BOOL bInit
);
154 void WINAPI
_ShellDDEInit(BOOL bInit
)
160 hRShell
= LoadLibraryW(L
"rshell.dll");
165 PSHELLDDEINIT func
= (PSHELLDDEINIT
)GetProcAddress(hRShell
, "ShellDDEInit");
173 hFallback
= GetModuleHandleW(L
"shell32.dll");
177 PSHELLDDEINIT func
= (PSHELLDDEINIT
) GetProcAddress(hFallback
, (LPCSTR
) 188);