Jump to content
Sign in to follow this  
heken

A window shown but not focused/active

Recommended Posts

heken

I'd like to have a window that appears on top of all the windows, but it's still unfocused (I wouldn't like it to get focus even for a ms if possible). What I'm trying to get is a rectangle whose content is some text. I'm really close to my goal, except for that matter. This is more or less what I've got so far:

GUICreate ("", $width, $height, $posx, $posy, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
$label = GUICtrlCreateLabel ($message, $posxL, $posyL, $widthL, $heightL)
GUICtrlSetColor ($label, 0x333333)
GUISetBkColor (0xffffff)
GUICtrlSetFont ($label, $size, 300, -1, "Courier New")

While 1
    Sleep($time1)
        
    GUISetState(@SW_SHOW)
    Sleep($time2)
    GUISetState(@SW_HIDE)
WEnd

Basically, I manage to keep it hidden from the task-bar and on top of the rest. However, the window that was active just before the autoit one lose the focus =(. Let's say I want a tool-tip behavior, but still need to use GUI in order to apply some format :S.

Any ideas are welcome. Thanks

Share this post


Link to post
Share on other sites
smashly

Hi,

#include<GuiConstants.au3>

GUICreate ("", 600, 60, -1, -1, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
$label = GUICtrlCreateLabel ("@SW_SHOWNA = Show Not Activated", 10, 10, 580, 40)
GUICtrlSetColor ($label, 0x333333)
GUISetBkColor (0xffffff)
GUICtrlSetFont ($label, 22, 300, -1, "Courier New")

While 1
    Sleep(350)
    GUISetState(@SW_SHOWNA)
    Sleep(650)
    GUISetState(@SW_HIDE)
WEnd

Cheers

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.