Sign in to follow this  
Followers 0
chazzmani

Vanishing GUI

4 posts in this topic

As soon as I launch, the GUI blinks on teh screen for a brief moment and then disappears. Any ideas why?

#NoTrayIcon

#include <GUIConstants.au3>

#include <Misc.au3>

;============================================

; GUI Creation

;============================================

GUICreate("Color", 245, 462)

GUICtrlCreateGroup("Colors", 0, 55, 245, 135)

$Inputcolor = GUICtrlCreateInput("", 100, 75, 86, 20)

GUICtrlCreateLabel("Color to look for", 9, 80, 83, 17)

GUICtrlCreateLabel("Color match sensitivity. Move the slider to the left for a precise match.", 30, 105, 179, 27)

GUICtrlCreateLabel("Precise Fuzzy", 15, 167, 200, 13)

$SensSlider = GUICtrlCreateSlider(20, 135, 180, 30)

GUICtrlSetLimit(-1,20,1)

GUICtrlSetData(-1,10)

GUICtrlCreateGroup("", -99, -99, 1, 1)

WinSetOnTop("Color", "", 1)

GUISetState(@SW_SHOW)

Thanks a bunch!

Share this post


Link to post
Share on other sites



Maybe...

#NoTrayIcon
#include <GUIConstants.au3>
#include <Misc.au3>
;============================================
; GUI Creation
;============================================

GUICreate("Color", 245, 462)
GUICtrlCreateGroup("Colors", 0, 55, 245, 135)
$Inputcolor = GUICtrlCreateInput("", 100, 75, 86, 20)
GUICtrlCreateLabel("Color to look for", 9, 80, 83, 17)
GUICtrlCreateLabel("Color match sensitivity. Move the slider to the left for a precise match.", 30, 105, 179, 27)
GUICtrlCreateLabel("Precise Fuzzy", 15, 167, 200, 13)
$SensSlider = GUICtrlCreateSlider(20, 135, 180, 30)
GUICtrlSetLimit(-1,20,1)
GUICtrlSetData(-1,10)
GUICtrlCreateGroup("", -99, -99, 1, 1)
WinSetOnTop("Color", "", 1)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

The GUI vanishes because the script ends after creating it. Add the following lines:

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Edit: Darn, Generator beat me :)

Edited by Marc

It's my job to comfort the disturbed and to disturb the comfortable.

Share this post


Link to post
Share on other sites

Maybe...

#NoTrayIcon
#include <GUIConstants.au3>
#include <Misc.au3>
;============================================
; GUI Creation
;============================================

GUICreate("Color", 245, 462)
GUICtrlCreateGroup("Colors", 0, 55, 245, 135)
$Inputcolor = GUICtrlCreateInput("", 100, 75, 86, 20)
GUICtrlCreateLabel("Color to look for", 9, 80, 83, 17)
GUICtrlCreateLabel("Color match sensitivity. Move the slider to the left for a precise match.", 30, 105, 179, 27)
GUICtrlCreateLabel("Precise Fuzzy", 15, 167, 200, 13)
$SensSlider = GUICtrlCreateSlider(20, 135, 180, 30)
GUICtrlSetLimit(-1,20,1)
GUICtrlSetData(-1,10)
GUICtrlCreateGroup("", -99, -99, 1, 1)
WinSetOnTop("Color", "", 1)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

THANKS!

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