Jump to content

Recommended Posts

Posted (edited)

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)
Posted (edited)

@Nine Thanks for your reply, I forgot to mention that I don't want my GUI to be "TopMost"

But you're right, the $WS_EX_TOPMOST prevent it to be hidden by Win+D, unfortunately I cannot use it in my case...

Edited by Taskms4
Posted

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

 

Posted

@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

 

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
  • Recently Browsing   0 members

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