Пример #1
0
void UI_KEYTRAP::create(UI_WINDOW* wnd, int key, void (*_user_function)(void))
{
	base_create(wnd, UI_KIND_BUTTON, 0, 0, 0, 0);

	pressed_down = 0;
	set_hotkey(key);
	set_callback(_user_function);

	parent = this;		// Ugly.  This keeps KEYTRAPS from getting keyboard control.
}
Пример #2
0
unsigned WINAPI bosskey_thread(void * lparam)
{
	MSG msg;
	LPWNDINFO lpInfo = (LPWNDINFO)lparam;
	set_hotkey(lpInfo);
	if ( is_browser()  || is_thunderbird() )
	{
		if ( init_bosskey(lpInfo) )
		{
			while( GetMessageW(&msg, NULL, 0, 0) > 0 )
			{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
				EnumWindows(find_chwnd, (LPARAM)lpInfo);
			}
		}
	}
	return (1);
}