Jump to content

[SOLVED] Prevent GUI disappearance after Win+D (Win10)


Taskms4
 Share

Recommended Posts

Greetings,

I didn't want to necro an old post, so I'm starting a new one... 


Like the OP of this post, I'm trying to create a "Tool" GUI (similar to Windows 7 gadgets) and I would need to force the GUI to stay "always up" even when Win + D is pressed.

The solution given on the previous post seems to be working on Win7 but I tried it on Win10 and it does not work..
Any kind of help would be appreciated :)

Thanks in advance,

--Taskms4

Edited by Taskms4
(marked as solved)
Link to comment
Share on other sites

Link to comment
Share on other sites

This works even better for me Win10 + Win7 :

#include <Constants.au3>
#include <GUIConstants.au3>
#include <WinAPI.au3>
#include <Array.au3>
#include <WinAPISysWin.au3>

Opt("MustDeclareVars", 1)

Global $hDesktop = WinGetHandle("Program Manager")
Local $aChild = _WinAPI_EnumChildWindows ($hDesktop,False)
; _ArrayDisplay ($aChild)

$hDesktop = $aChild[1][0]

Global $hGui = GUICreate("Test", 200, 200, -1, -1, $WS_POPUP+$WS_CAPTION)
_WinAPI_SetWindowLong($hGui, $GWL_HWNDPARENT, $hDesktop)

GUISetState()

While 1
  Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
      ExitLoop

  EndSwitch
WEnd

 

Link to comment
Share on other sites

@Nine my apologies you were right!

The following code (from the old post) is not working for me:

Global $hDesktop = ControlGetHandle("[CLASS:Progman]", "", "SysListView321")
Global $hGui = GUICreate("Non Minimizable", 500, 500, -1, -1, $WS_MAXIMIZEBOX)
_WinAPI_SetWindowLong($hGui, $GWL_HWNDPARENT, $hDesktop)

But yours works perfectly fine 😮

Global $hDesktop = WinGetHandle("Program Manager")
Global $hGui = GUICreate("Test", 200, 200, -1, -1, $WS_POPUP+$WS_CAPTION)
_WinAPI_SetWindowLong($hGui, $GWL_HWNDPARENT, $hDesktop)

 

Thank you so much! :D

 

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...