Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

hide and restore help


  • Please log in to reply
2 replies to this topic

#1 vladedoty

vladedoty

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 24 August 2009 - 02:32 PM

when i open the gui the hide button works fine, then when i click restore in the tray, it works fine. But then I try and press hide again to hide it or exit to exit out.... and it does nothing. What am I doing wrong?

Here is my code.

AutoIt         
While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $exitBtn             Exit         Case $hideBtn             Hide()         Case $startBtn             Start()     EndSwitch WEnd While 1     $msg = GUIGetMsg()     Select                 Case $msg = 0                         ContinueLoop         Case $msg = $restoreitem             GUISetState(@SW_SHOW, $mainGUI)         Case $msg = $hideitem             GUISetState(@SW_HIDE, $mainGUI)         Case $msg = $aboutitem             Msgbox(64,"about:","created by Webber04")         Case $msg = $exititem             Exit     EndSelect WEnd Func Hide()     GUISetState(@SW_HIDE, $mainGUI)     While 1         Sleep(10)     WEnd     Exit EndFunc Func AboutClick()     MsgBox(0, "About", "by Webber04") EndFunc   ;==>AboutClicked Func RestoreClick()     GUISetState(@SW_SHOW, $mainGUI) EndFunc   ;==>RestoreClicked Func ExitEvent()     Exit EndFunc

Edited by vladedoty, 24 August 2009 - 02:34 PM.








#2 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 22,104 posts

Posted 24 August 2009 - 02:47 PM

vladedoty,

The first thing I noticed was 2 GUIGetMsg() loops - why?

And then when I looked at your Hide function, I found this:
Func Hide()     GUISetState(@SW_HIDE, $mainGUI)     While 1         Sleep(10)     WEnd     Exit EndFunc

This function will never end as you set up an infinite loop with no possibility of exit.

So it is hardly surprising that your script has problems. Please post the full script - at the moment it is impossible to say what else might be causing you problems.

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#3 vladedoty

vladedoty

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 24 August 2009 - 03:19 PM

vladedoty,

The first thing I noticed was 2 GUIGetMsg() loops - why?

And then when I looked at your Hide function, I found this:

Func Hide()     GUISetState(@SW_HIDE, $mainGUI)     While 1         Sleep(10)     WEnd     Exit EndFunc

This function will never end as you set up an infinite loop with no possibility of exit.

So it is hardly surprising that your script has problems. Please post the full script - at the moment it is impossible to say what else might be causing you problems.

M23

nevermind i fixed it.
just added the l2 GUIMSG to the Start function.
and thx to your help, got rid of the while loop in the hide function.

Thx again




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users