Sign in to follow this  
Followers 0
heken

A window shown but not focused/active

3 posts in this topic

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



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

Oh, man, many thanks!! Simpler is nothing. Great!

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  
Followers 0