Jump to content

Mouse vanishes in main GUI as soon as a second GUI is created


Braste84
 Share

Go to solution Solved by Braste84,

Recommended Posts

I am using a GUI for some checkboxes and buttons

$ScriptEngine = GUICreate("Script Engine", 619, 308, -1523, 321)
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")
....
GUISetState(@SW_SHOW)

But as soon as I create a second GUI as child of the program window I am interacting with, the mouse cursor vanishes in the main GUI. The second GUI is meant as an overlay, whiches moves with the program.

$overlay = GUICreate("", 200, 500, 0, 0, $WS_CHILD, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED), $pHandle)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($overlay, 0xABCDEF)
GUISetState()
_GDIPlus_Startup()
$overlayGraphic = _GDIPlus_GraphicsCreateFromHWND($overlay)
_GDIPlus_GraphicsSetTextRenderingHint ($overlayGraphic, 3)

 

Edited by Braste84
Link to comment
Share on other sites

  • Braste84 changed the title to Mouse vanishes in main GUI as soon as a second GUI is created
  • Solution

Nevermind. I don't have the time to make a working example code at the moment and I won't post my complete script here. I switched from 

$overlay = GUICreate("", 200, 500, 0, 0, $WS_CHILD, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED), $pHandle)

to

$overlay = GUICreate("", 200, 500, 0, 0, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED))

and do the positioning of the overlay myself. Now everything works.

Edited by Braste84
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...