Jump to content
Sign in to follow this  

Minimizing $WS_POPUP windows

Recommended Posts


Windows created with the $WS_POPUP style have the annoying feature of not minimizing like other windows when you click on their taskbar button (when they are the currently active window).

I was thinking of getting around this by registering a function which minimizes the window against the appropriate windows message using GuiRegisterMsg().

I've cracked my head trying to figure out which of the window messages listed in the help file is the one I want. I've tried anything that could remotely sound like what I want, and no luck.

It's impractical to test against each and every one of those window messages, so if anyone knew what the message code that I am looking for is, I'd be really grateful.

(or alternatively, another solution to the issue I'm trying to solve would do just fine). Thanks!

Share this post

Link to post
Share on other sites

Maybe you can use a button

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
$GUI = GUICreate("Example",300,300,-1,-1,$WS_POPUP) ;GUI
$Button1 = GUICtrlCreateButton("_",5,5) ;Minimize button


While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $Button1
GUISetState(2) ;This is minimize

I hope this is where you are looking for ;)

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post

Link to post
Share on other sites

I've just did a test using GUIRegisterMsg ( $WM_ACTIVATE , "Func" ) and it did the trick(detecting if window is being avtivated by somthing)

but I don't know what the wParam returns... msdn


here's my code:

GUIRegisterMsg ( $WM_ACTIVATE , "__Minimize" )

Func __Minimize($hWndGUI, $MsgID, $WParam, $LParam);Minimize when window is inactive
    If $Wparam <> 1 Then GUISetState(@SW_MINIMIZE)
Edited by MiserableLife

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.