Jump to content
Sign in to follow this  
VAG

Seperate Status Window during my script run

Recommended Posts

VAG

I'm trying to write a GUI to display my test script posting during test run. I have try to create a function show the GUI. There are also functions to handle message posting, event buttons and progress bar increments in this GUI. However, I notice that I need put a loop at the end of function to keep the GUI on screen. Is there any way to show the GUI and allow it to be control by other functions later? :)

CODE

Func _ProgressForm_Show(ByRef $s_control, $s_location)

;Set GUI Window position on desktop

Switch $s_location

Case "Bottom-Right"

$h_Form_TestProgress = GUICreate("Test Progress", 269, 279, @DesktopWidth - 269, @DesktopHeight - 279 - 30)

Case "Bottom-Left"

$h_Form_TestProgress = GUICreate("Test Progress", 269, 279, 0, @DesktopHeight - 279 - 30)

Case "Top-Right"

$h_Form_TestProgress = GUICreate("Test Progress", 269, 279, @DesktopWidth - 269, 0)

Case "Top-Left"

$h_Form_TestProgress = GUICreate("Test Progress", 269, 279, 0, 0)

Case Else

$s_location = "Unknown"

EndSwitch

;Draw GUI objects in window

$h_Pic_Logo = GUICtrlCreatePic(@ScriptDir & "\Progress.bmp", 0, 0, 270, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$h_Editbox_Posting = GUICtrlCreateEdit("", 0, 89, 270, 235, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL))

$h_Progressbar_TestStatus = GUICtrlCreateProgress(6, 64, 240, 19)

$h_Button_Stop = GUICtrlCreateButton("Stop", 144, 240, 89, 33, 0)

GUICtrlSetOnEvent($h_Button_Stop, "_ProgressForm_StopTestButton")

;Show window on screen

GUISetState(@SW_SHOW)

;Return control identifier (controlID) which required changes later

If $s_control = 0 Then

SetError(1)

Return 0

Else

;~ Dim $a_info[3]

$a_info[0] = $s_control ;ControlID

$a_info[1] = $h_Progressbar_TestStatus ;ProgressbarID

$a_info[2] = $h_Editbox_Posting ;EditboxID

;~ Return $a_info

EndIf

;~ ;Endless While loop to keep the GUI Open

;~ While 1

;~ $nMsg = GUIGetMsg()

;~ Switch $nMsg

;~ Case $GUI_EVENT_CLOSE

;~ Exit

;~ EndSwitch

;~ WEnd

EndFunc

Share this post


Link to post
Share on other sites
FireFox

@VAG

GuiSetState()

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  

×