Jump to content
Sign in to follow this  
ashley

GUI Dissaper when i right click.

Recommended Posts

ok well ita a very small gui that appears on your task bar, but when u right click on the task bar it dissapers any ideas here my code:

CODE
;Include constants

#include <GUIConstants.au3>

#NoTrayIcon

$GUI = GUICreate("", 100, 25, @DesktopWidth- 300, @DesktopHeight -27, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), 0x00000088)

;Set color (black)

GUISetBkColor(0x000000)

;set the text - No more than 10 chars

$Label1 = GUICtrlCreateLabel("Test", 25, 5, 60, 17)

;pick the color

GUICtrlSetColor(-1, 0xFFFFFF)

;choose an icon

$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\shell32.dll", -160, 8, 5, 15, 15, BitOR($SS_NOTIFY,$WS_GROUP))

;Show window/Make the window visible

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

If you can fix it that would help.

Share this post


Link to post
Share on other sites

Hmm...maybe you need to keep the GUI active after you've clicked.

Something deletes the GUI...because...i checked my process list..and i had 7 autoit3.exe's :D

Edited by Swift

Share this post


Link to post
Share on other sites

ashley - I found out what is wrong when I set the task bar to auto-hide - your gui is being covered up by the task-bar. I found out using this modification of your code:

;Include constants
HotKeySet("{ESC}", "EXIT_MYScript")
#include <GUIConstants.au3>
#NoTrayIcon


$GUI = GUICreate("", 100, 25, @DesktopWidth - 300, @DesktopHeight - 27, $WS_POPUP);BitOR($WS_POPUP, $WS_CLIPSIBLINGS), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

;Set color (black)
GUISetBkColor(0x000000)

;set the text - No more than 10 chars
$Label1 = GUICtrlCreateLabel("Test", 25, 5, 60, 17)

;pick the color
GUICtrlSetColor(-1, 0xFFFFFF)

;choose an icon
$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\shell32.dll", -160, 8, 5, 15, 15, BitOR($SS_NOTIFY, $WS_GROUP))

;Show window/Make the window visible
GUISetState(@SW_SHOW)
WinSetOnTop($GUI, "", 1)
While 1
    $nMsg = GUIGetMsg()
;GUISetState(@SW_SHOW)
    Sleep(80)
;Switch $nMsg
;   Case $GUI_EVENT_CLOSE
;       Exit
;EndSwitch
WEnd

Func EXIT_MYScript()
    Exit
EndFunc

The GUI doesn't disappear, it gets covered up by the task-bar which, I guess, won't let any other windows cover it up, if it isn't set to auto-hide.

Edited by Squirrely1

Share this post


Link to post
Share on other sites

Use WinGetState() to check if it's visible and then WinSetOnTop() or _WinAPI_SetWindowPos to set it on top of your taskbar again :D

Share this post


Link to post
Share on other sites

I had some free time so I did this

;Include constants
#include <GUIConstants.au3>
#NoTrayIcon


$GUI = GUICreate("Gui1", 100, 25, @DesktopWidth- 300, @DesktopHeight -27, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), 0x00000088)

;Set color (black)
GUISetBkColor(0x000000)

;set the text - No more than 10 chars
$Label1 = GUICtrlCreateLabel("Test™", 25, 5, 60, 17)

;pick the color
GUICtrlSetColor(-1, 0xFFFFFF)

;choose an icon
$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\shell32.dll", -160, 8, 5, 15, 15, BitOR($SS_NOTIFY,$WS_GROUP))

;Show window/Make the window visible
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    $state = WinGetState("Gui1")
    If BitAnd($state, 2) Then WinSetOnTop("Gui1", "", 1)
WEnd

Works good for me!! :P

Edit: this was what you wanted ashley, right?? :D

Edited by TzarAlkex

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  

×
×
  • Create New...