mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 01:13:38 +00:00
[apihooksrv]
- Commit a test utility that can install user api hooks and give for the first time real themes support. This is a temporary test program till the same functionality is integrated to winlogon. To use it someone has to activate themes with themecfg and then run "apihook uxtheme.dll". Also note that it is possible to use this tool in windows for testing purposes svn path=/branches/GSoC_2011/ThemesSupport/; revision=52665
This commit is contained in:
parent
ab880775f5
commit
eb23bde458
|
@ -1,5 +1,6 @@
|
|||
|
||||
add_subdirectory(themecfg)
|
||||
add_subdirectory(apihooksrv)
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
|
13
dll/win32/uxtheme/apihooksrv/CMakeLists.txt
Normal file
13
dll/win32/uxtheme/apihooksrv/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
set_rc_compiler()
|
||||
|
||||
list(APPEND SOURCE
|
||||
apihooksrv.c)
|
||||
|
||||
add_executable(apihooksrv ${SOURCE})
|
||||
|
||||
set_module_type(apihooksrv win32cui)
|
||||
|
||||
add_importlibs(apihooksrv msvcrt user32 kernel32)
|
||||
|
||||
add_cd_file(TARGET apihooksrv DESTINATION reactos/system32 FOR all)
|
57
dll/win32/uxtheme/apihooksrv/apihooksrv.c
Normal file
57
dll/win32/uxtheme/apihooksrv/apihooksrv.c
Normal file
|
@ -0,0 +1,57 @@
|
|||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <windows.h>
|
||||
|
||||
typedef BOOL (WINAPI * PTHEMESHOOKINSTALL) ();
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
HMODULE hmodRosTheme;
|
||||
PTHEMESHOOKINSTALL fnInstall, fnRemove;
|
||||
BOOL ret;
|
||||
DWORD info = BSM_APPLICATIONS;
|
||||
|
||||
if ( argc != 2 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//hmodRosTheme = LoadLibrary(L"C:\\Reactos\\src\\themes-priv\\output-MinGW-i386\\reactos\\dll\\win32\\uxtheme\\rostheme.dll");
|
||||
hmodRosTheme = LoadLibrary(argv[1]);
|
||||
if(!hmodRosTheme)
|
||||
{
|
||||
printf("failed to load rostheme\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fnInstall = GetProcAddress(hmodRosTheme, (LPCSTR)34);
|
||||
fnRemove = GetProcAddress(hmodRosTheme, (LPCSTR)35);
|
||||
|
||||
if(!fnInstall)
|
||||
{
|
||||
printf("failed to get ThemeHooksInstall\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!fnRemove)
|
||||
{
|
||||
printf("failed to get ThemeHooksRemove\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = fnInstall();
|
||||
printf("ThemeHooksInstall returned %d\n", ret);
|
||||
|
||||
BroadcastSystemMessage(BSF_POSTMESSAGE, &info,WM_SETFOCUS,0,0);
|
||||
|
||||
Sleep(36000);
|
||||
|
||||
ret = fnRemove();
|
||||
printf("ThemeHooksRemove returned %d\n", ret);
|
||||
|
||||
BroadcastSystemMessage(BSF_POSTMESSAGE, &info,WM_SETFOCUS,0,0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue