John117 Posted December 7, 2007 Posted December 7, 2007 (edited) Can someone please get this to work on the top, bottom and right side. -it will close if you are off the gui to the right but not the rest . . . . expandcollapse popupGlobal $ParentWin_Width = 450 Global $ParentWin_Height = 700 Global $ParentWin_Left = ((@DesktopWidth - $ParentWin_Width) / 2) Global $Top = 25 Global $ParentWin = GUICreate("Example", 450, $ParentWin_Height, $ParentWin_Left, $Top) Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_Custom_Exit") GUISetState(@SW_SHOW, $ParentWin) While 1 Sleep(1000) Global $size = WinGetPos($ParentWin) Global $pos = MouseGetPos() ;MouseLeft < GuiLeft If $pos[0] > $size[0] Then ;MouseRight > GuiRight If $pos[0] < ($size[0] + $size[2]) Then ;MouseTop < GuiTop If $pos[1] > $size[1] Then ;MouseBottom > GuiBottom If $pos[1] < ($size[1] + 500) Then _Expand() Else ;MsgBox(0, "if 4", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 3", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 2", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 1", "NotWorking") _Colapse() EndIf WEnd Func _Colapse() ;WinMove ( "title", "text", x, y [, width [, height[, speed]]] ) If $size[3] > 40 Then For $i = $ParentWin_Height To 40 Step - 5 WinMove($ParentWin, "", $size[0], $size[1], $size[2], $i) Next EndIF EndFunc ;==>_Colapse Func _Expand() ;MsgBox(0, "if 5", "working") If $size[3] = 40 Then For $i = 40 To $ParentWin_Height Step 5 WinMove($ParentWin, "", $size[0], $size[1], $size[2], $i) Next EndIf EndFunc ;==>_Expand Func _Custom_Exit() Exit EndFunc ;==> _exit() Edited December 8, 2007 by Hatcheda
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now