Works very, very well now

This commit is contained in:
andreja6
2019-11-05 23:10:32 -08:00
parent 01bc10f852
commit 559dfea041
2 changed files with 8 additions and 6 deletions

View File

@@ -58,10 +58,13 @@ void Application::setFocus(bool focus)
{
if(focus)
{
MessageBox(NULL, "NO", "NO", MB_OK);
SetWindowPos(_propWindow->_hwndProp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ShowWindow(_propWindow->_hwndProp, SW_SHOW);
SetWindowPos(_propWindow->_hwndProp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
else
{
SetWindowPos(_propWindow->_hwndProp, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
else SetWindowPos(_propWindow->_hwndProp, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
Application::Application(HWND parentWindow) { //: GApp(settings,window) {

View File

@@ -74,10 +74,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_SIZE:
app->resizeWithParent(hwnd);
break;
case WM_ACTIVATEAPP:
if(wParam == FALSE) app->setFocus(false);
case WM_ACTIVATE:
if(wParam > WA_INACTIVE) app->setFocus(false);
else app->setFocus(true);
break;
default:
{
return DefWindowProc(hwnd, msg, wParam, lParam);