Browse Source

ShowCursor does now work from different threads

Kolja Strohm 1 year ago
parent
commit
15633e6973
3 changed files with 4 additions and 0 deletions
  1. 1 0
      Fenster.cpp
  2. 2 0
      Global.cpp
  3. 1 0
      Globals.h

+ 1 - 0
Fenster.cpp

@@ -60,6 +60,7 @@ WNDCLASSEX Framework::F_NormalEx(HINSTANCE hInst)
 LRESULT CALLBACK Framework::WindowProc(
     HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 {
+    setShowCursor(cursorVisible);
     if (msgExit) return (DefWindowProc(hwnd, message, wparam, lparam));
     switch (message)
     {

+ 2 - 0
Global.cpp

@@ -40,6 +40,7 @@ void Framework::initFramework(HINSTANCE__* hInst)
     _hinst = hInst;
     istInitialisiert = 1;
     debugDX = 0;
+    cursorVisible = 1;
 }
 
 void Framework::releaseFramework()
@@ -159,6 +160,7 @@ void Framework::setShowCursor(bool visible)
     info.cbSize = sizeof(CURSORINFO);
     GetCursorInfo(&info);
     if ((info.flags != 0) == (visible == 0)) ShowCursor(visible);
+    cursorVisible = visible;
 }
 
 #endif

+ 1 - 0
Globals.h

@@ -41,6 +41,7 @@ namespace Framework
     Global HINSTANCE__* _hinst;
     Global DLLRegister* dlls;
     Global bool debugDX;
+    Global bool cursorVisible;
 
 #ifdef WIN32
     //! Gibt die Koordinaten der Maus auf dem Bildschirm zurück