本文整理汇总了C++中refexport_t::AppActivate方法的典型用法代码示例。如果您正苦于以下问题:C++ refexport_t::AppActivate方法的具体用法?C++ refexport_t::AppActivate怎么用?C++ refexport_t::AppActivate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类refexport_t
的用法示例。
在下文中一共展示了refexport_t::AppActivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckActive
void CheckActive (HWND hWnd) // jit - for some reason, we sometimes don't get events for the window becaming active/inactive, so just check the forground window all the time...
{
HWND foreground = GetForegroundWindow();
static qboolean newwindow = true;
static qboolean lastactive = false;
qboolean active = false;
qboolean minimized = false; // foreground should be null when minimized?
if (!hWnd)
return;
if (foreground == hWnd)
{
active = true;
}
if (lastactive != active)
{
AppActivate(active, minimized, newwindow);
if (reflib_active)
re.AppActivate(active);
newwindow = false;
lastactive = active;
}
}
示例2: MainWndProc
/*
====================
MainWndProc
main window procedure
====================
*/
LONG WINAPI MainWndProc (
HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
LONG lRet = 0;
if ( uMsg == MSH_MOUSEWHEEL )
{
if ( ( ( int ) wParam ) > 0 )
{
Key_Event( K_MWHEELUP, 1, sys_msg_time );
Key_Event( K_MWHEELUP, 0, sys_msg_time );
}
else
{
Key_Event( K_MWHEELDOWN, 1, sys_msg_time );
Key_Event( K_MWHEELDOWN, 0, sys_msg_time );
}
return DefWindowProc (hWnd, uMsg, wParam, lParam);
}
switch (uMsg)
{
case WM_MOUSEWHEEL:
/*
** this chunk of code theoretically only works under NT4 and Win98
** since this message doesn't exist under Win95
*/
if ( ( short ) HIWORD( wParam ) > 0 )
{
Key_Event( K_MWHEELUP, 1, sys_msg_time );
Key_Event( K_MWHEELUP, 0, sys_msg_time );
}
else
{
Key_Event( K_MWHEELDOWN, 1, sys_msg_time );
Key_Event( K_MWHEELDOWN, 0, sys_msg_time );
}
break;
case WM_HOTKEY:
return 0;
case WM_CREATE:
cl_hwnd = hWnd;
MSH_MOUSEWHEEL = RegisterWindowMessage("MSWHEEL_ROLLMSG");
return DefWindowProc (hWnd, uMsg, wParam, lParam);
case WM_PAINT:
SCR_DirtyScreen (); // force entire screen to update next frame
return DefWindowProc (hWnd, uMsg, wParam, lParam);
case WM_DESTROY:
// let sound and input know about this?
cl_hwnd = NULL;
return DefWindowProc (hWnd, uMsg, wParam, lParam);
case WM_ACTIVATE:
{
int fActive, fMinimized;
// KJB: Watch this for problems in fullscreen modes with Alt-tabbing.
fActive = LOWORD(wParam);
fMinimized = (int) HIWORD(wParam);
AppActivate( fActive != WA_INACTIVE, fMinimized);
if ( reflib_active )
re.AppActivate( !( fActive == WA_INACTIVE ) );
}
return DefWindowProc (hWnd, uMsg, wParam, lParam);
case WM_MOVE:
{
int xPos, yPos;
RECT r;
int style;
if (!vid_fullscreen->value)
{
xPos = (short) LOWORD(lParam); // horizontal position
yPos = (short) HIWORD(lParam); // vertical position
r.left = 0;
r.top = 0;
r.right = 1;
r.bottom = 1;
style = GetWindowLong( hWnd, GWL_STYLE );
AdjustWindowRect( &r, style, 0 );
//.........这里部分代码省略.........