mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-25 02:00:54 +00:00
Changed: Prevent Windows to draw background of NeL windows and some other messages
This commit is contained in:
parent
752af53f15
commit
0879534851
1 changed files with 33 additions and 21 deletions
|
@ -56,9 +56,13 @@ namespace NL3D
|
|||
bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
H_AUTO_OGL(GlWndProc)
|
||||
|
||||
if (!driver)
|
||||
return false;
|
||||
|
||||
if(message == WM_SIZE)
|
||||
{
|
||||
if (driver != NULL)
|
||||
if (!driver->_FullScreen)
|
||||
{
|
||||
RECT rect;
|
||||
GetClientRect (driver->_win, &rect);
|
||||
|
@ -70,7 +74,7 @@ bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||
}
|
||||
else if(message == WM_MOVE)
|
||||
{
|
||||
if (driver != NULL)
|
||||
if (!driver->_FullScreen)
|
||||
{
|
||||
RECT rect;
|
||||
GetWindowRect (hWnd, &rect);
|
||||
|
@ -113,14 +117,37 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||
trapMessage = GlWndProc (pDriver, hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
// we don't want Windows to erase background
|
||||
if (message == WM_ERASEBKGND)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (message == WM_SYSCOMMAND)
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
#ifdef NL_DISABLE_MENU
|
||||
// disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu)
|
||||
if(message == WM_SYSCOMMAND && wParam == SC_KEYMENU)
|
||||
return 0;
|
||||
case SC_KEYMENU:
|
||||
#endif // NL_DISABLE_MENU
|
||||
|
||||
// Screensaver Trying To Start?
|
||||
case SC_SCREENSAVE:
|
||||
|
||||
// Monitor Trying To Enter Powersave?
|
||||
case SC_MONITORPOWER:
|
||||
|
||||
// Prevent From Happening
|
||||
return 0;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// disable menu (default ALT-F4 behavior is disabled)
|
||||
if(message == WM_CLOSE)
|
||||
if (message == WM_CLOSE)
|
||||
{
|
||||
if(pDriver && pDriver->ExitFunc)
|
||||
{
|
||||
|
@ -219,21 +246,6 @@ bool GlWndProc(CDriverGL *driver, XEvent &e)
|
|||
}
|
||||
|
||||
return true;
|
||||
|
||||
/*
|
||||
else if (message == WM_ACTIVATE)
|
||||
{
|
||||
WORD fActive = LOWORD(wParam);
|
||||
if (fActive == WA_INACTIVE)
|
||||
{
|
||||
driver->_WndActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
driver->_WndActive = true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
#endif // NL_OS_UNIX
|
||||
|
|
Loading…
Reference in a new issue