pintas Posted January 20, 2009 Posted January 20, 2009 I have two buttons, one on top of another, and i want the pressed button to hide and to show the other. Button one, will show some extra functions, button two, will hide them. What is wrong with this script? expandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Opt("GUIOnEventMode", 1) $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53) , $WS_POPUP, $WS_EX_TOOLWINDOW) While 1 $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($Button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($Button2, $GUI_HIDE) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop( " ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUICtrlRead() Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd WEnd Help please.
Moderators Melba23 Posted January 20, 2009 Moderators Posted January 20, 2009 pintas,You obviously did not bother to try and run your script before posting. If you had you would have discovered that you should be using GUIGetMsg and not GUICtrlRead in your Switch statement. As to why it will not work once you have fixed this, AutoIt does not like overlapping active controls. It cannot tell which control is being activated (I assume it looks for mouse-click coordinates within the GUI). So your 2 buttons must be in separate places if both are active. One way I can think of that might make it work would be to ENABLE/DISABLE as well as SHOW/HIDE the buttons. Give that a try and come back if it does not work.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
pintas Posted January 20, 2009 Author Posted January 20, 2009 (edited) I did bother to try that, i just thought that wasn't the way to do it. I'm fairly new to Autoit. But that doesn't solve my problem at all... Regarding Autoit not liking overlapping, i'm sure it doesn't, but i'm also sure it's possible to do so. Thanks anyway. Anyone? Please? Edited January 20, 2009 by pintas
rasim Posted January 20, 2009 Posted January 20, 2009 @pintas#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd
pintas Posted January 20, 2009 Author Posted January 20, 2009 Amazing Rasim. I would never get that. Thank you so much!
pintas Posted January 20, 2009 Author Posted January 20, 2009 Ok, now i have another problem... The animation is lost without Opt("GUIOnEventMode", 1). expandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) GUISetOnEvent($gui_event_close, "bye") $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd Func bye(); ==>bye $2gui = GUICreate("bye", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) _GuiRoundCorners($2gui, 0, 0, 3, 3) GUICtrlCreateLabel("XAU!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndFunc ; ==>bye Any way to fix this?
KaFu Posted January 20, 2009 Posted January 20, 2009 Opt("OnExitFunc","bye") should do the same... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Moderators Melba23 Posted January 20, 2009 Moderators Posted January 20, 2009 pintas,Apologies. I could have phrased that earlier post better.And I did not spot the Opt("GUIOnEventMode", 1) - 2 helpings of humble pie tonight!Hope I can be of more help next time.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
pintas Posted January 20, 2009 Author Posted January 20, 2009 Opt("OnExitFunc","bye") doesn't solve it either... It only works when i exit the program by right clicking on the icon tray and displays only half of the animation. Suggestions please.
KaFu Posted January 20, 2009 Posted January 20, 2009 expandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd $2gui = GUICreate("bye", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175), $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) ;_GuiRoundCorners($2gui, 0, 0, 3, 3) GUICtrlCreateLabel("XAU!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
pintas Posted January 21, 2009 Author Posted January 21, 2009 I'm sorry, the function used a button to exit, i forgot to put it in the example code... So, that doesn't work... How can use the animation? Help please, i'm going crazy expandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) GUISetOnEvent($gui_event_close, "bye") $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) GUICtrlCreateButton("Exit", 185, 90, 50, 25); EXIT BUTTON BYE FUNCTION GUICtrlSetOnEvent(-1, "bye") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd Func bye(); ==>bye $2gui = GUICreate("bye", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) _GuiRoundCorners($2gui, 0, 0, 3, 3) GUICtrlCreateLabel("BYE!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndFunc ; ==>bye
pintas Posted January 21, 2009 Author Posted January 21, 2009 pintas, Apologies. I could have phrased that earlier post better. And I did not spot the Opt("GUIOnEventMode", 1) - 2 helpings of humble pie tonight! Hope I can be of more help next time. M23 No problem man. But i keep bumping into errors. This little script (1000 lines so far) i'm making is for a login screen that uses a virtual keyboard and i found a way to get that animation working without the Opt("GUIOnEventMode", 1), by naming the button and placing it inside the 'while' statement, like such: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) Case $Exit ;HERE $2gui = GUICreate("xau", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("xau", "", 220) GUISetBkColor(0x000000) GUICtrlCreateLabel("BYE!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndSwitch WEnd The problem now is that the keyboard input doesn't work at all without the Opt("GUIOnEventMode", 1). I'm using the buttons with GuiCtrlSetOnEvent and nothing happens. What can i do to solve this? Can't i use Opt("GUIOnEventMode", 1) and still use those buttons? Btw, the show/hide button is supposed to be the shift key for the keyboard.
rasim Posted January 21, 2009 Posted January 21, 2009 @pintasDo not mix the GUI MessageLoop Mode and the GUI OnEvent Modeexpandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) $cButton_Exit = GUICtrlCreateButton("Exit", 185, 90, 50, 25); EXIT BUTTON BYE FUNCTION GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Switch GUIGetMsg() Case $gui_event_close, $cButton_Exit bye() Exit Case $button1 GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) Case $button2 GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndSwitch WEnd Func bye(); ==>bye $2gui = GUICreate("bye", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175), $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) ;_GuiRoundCorners($2gui, 0, 0, 3, 3) GUICtrlCreateLabel("BYE!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndFunc ;==>bye
pintas Posted January 21, 2009 Author Posted January 21, 2009 (edited) Thank you so much Rasim. That help quite alot, but if you read my post above yours, the button input doesn't work without the Opt("GUIOnEventMode", 1). So i'm back to square one... I'm trying something like this, but with a shift key, because i'm making a full virtual keyboard for the login. expandcollapse popup#include <md5.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Opt("GUIOnEventMode", 1) Opt("TrayMenuMode", 0) Global $pass = "", $key = "0xc4ca4238a0b923820dcc509a6f75849b" $gui = GUICreate(" ·.·.·", 155, 108, @DesktopWidth - (155 + 12), @DesktopHeight - (90 + 53) , $WS_POPUP, $WS_EX_TOOLWINDOW) $1button = GUICtrlCreateButton("1", 4, 5, 30) GUICtrlSetOnEvent($1button, "_ButtonPress") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) GUICtrlCreateButton("OK", 4, 78, 72) GUICtrlSetOnEvent(-1, "accept") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) GUICtrlCreateButton("CANCEL", 77, 78, 72) GUICtrlSetOnEvent(-1, "bye") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop( " ·.·.·", "", 1) GUISetState() TraySetState() Func _ButtonPress() $pass &= GUICtrlRead(@GUI_CtrlId) GUICtrlSetData($gui, GUICtrlRead($gui) & "*") EndFunc; ==>_ButtonPress Func bye(); ==>bye $2gui = GUICreate("xau", 155, 30, @DesktopWidth - (155 + 12), @DesktopHeight - (30 + 145) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) GUICtrlCreateLabel("BYE!", 63, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndFunc ; ==>bye While 1 Sleep(100) Wend Func accept() If _MD5($pass) = $key then $2gui = GUICreate("right", 155, 30, @DesktopWidth - (155 + 12), @DesktopHeight - (30 + 145) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans("right", "", 220) GUISetBkColor(0x000000) GUICtrlCreateLabel("BEM VINDO", 48, 8, 146, 98) GUICtrlSetColor(-1, 0x00ff00) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(1000) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) GUIDelete($gui) GUIDelete($2gui) ;ENTER Exit Else $2gui = GUICreate("reject", 155, 30, @DesktopWidth - (155 + 12), @DesktopHeight - (30 + 145) , $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("reject", "", 220) GUISetBkColor(0x000000) GUICtrlCreateLabel("ERRADO!", 52, 8, 146, 98) GUICtrlSetColor(-1, 0xff0000) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(1000) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) WinSetTrans(" ·.·.·", "", 220) $pass = "" EndIf EndFunc Edited January 21, 2009 by pintas
fctd Posted January 21, 2009 Posted January 21, 2009 This works fine for me. expandcollapse popup#include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Opt("GUIOnEventMode", 1) $gui = GUICreate(" ·.·.·", 320, 120, @DesktopWidth - (320 + 12), @DesktopHeight - (120 + 53), $WS_POPUP, $WS_EX_TOOLWINDOW) $button1 = GUICtrlCreateButton("Button1", 5, 65, 40, 20) GUICtrlSetOnEvent(-1, "Button1") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000); Red GUICtrlSetState($button1, $GUI_SHOW) $button2 = GUICtrlCreateButton("Button2", 5, 65, 40, 20) GUICtrlSetOnEvent(-1, "Button2") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x008000); Green GUICtrlSetState($button2, $GUI_HIDE) $cButton_Exit = GUICtrlCreateButton("Exit", 185, 90, 50, 25); EXIT BUTTON BYE FUNCTION GUICtrlSetOnEvent(-1, "bye") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop(" ·.·.·", "", 1) TraySetState() GUISetState() While 1 Sleep(100) WEnd Func Button1() GUICtrlSetState($button1, $GUI_HIDE) GUICtrlSetState($button2, $GUI_SHOW) EndFunc Func Button2() GUICtrlSetState($button1, $GUI_SHOW) GUICtrlSetState($button2, $GUI_HIDE) EndFunc Func bye(); ==>bye $2gui = GUICreate("bye", 320, 30, @DesktopWidth - (320 + 12), @DesktopHeight - (30 + 175), $WS_POPUP, $WS_EX_TOOLWINDOW) WinSetTrans(" ·.·.·", "", 120) WinSetTrans("bye", "", 220) GUISetBkColor(0x000000) ;_GuiRoundCorners($2gui, 0, 0, 3, 3) GUICtrlCreateLabel("BYE!", 150, 8, 146, 98) GUICtrlSetColor(-1, 0xffffff) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00040008); slide-in Sleep(500) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $2gui, "int", 200, "long", 0x00050004) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 400, "long", 0x00050004) Exit EndFunc ;==>bye [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font]
pintas Posted January 21, 2009 Author Posted January 21, 2009 Wow! That's just PERFECT! Thank you man. That just solves everything. So many ways to do the same confuse me
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