vi6ora Posted August 10, 2009 Posted August 10, 2009 Hi folks its me again. I want to make a image wich when you click it, a function will execute ( like a button ). Here is my code expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> $Form1 = GUICreate("[VAL]Vitality Aion Launcher", 696, 481, 192, 127) FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\V3 copy.jpg", @TempDir & "\V3 copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Buttons\Homepage copy.jpg", @TempDir & "\Homepage copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Buttons\Forum.jpg", @TempDir & "\Forum.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Buttons\! copy.jpg", @TempDir & "\! copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Buttons\launch copy.jpg", @TempDir & "\launch copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Buttons\Vote2 copy.jpg", @TempDir & "\Vote2 copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\status button copy.jpg", @TempDir & "\status button copy.jpg") FileInstall("C:\Documents and Settings\Administrator\Desktop\[VAL]\Select copy.jpg", @TempDir & "\Select copy.jpg") $Pic1 = GUICtrlCreatePic(@TempDir & "\V3 copy.jpg", 0, 0, 692, 476, 0) $SavePath = GUICtrlCreateInput("", 80, 312, 185, 21) $Forum = GUICtrlCreatePic(@TempDir & "\Forum.jpg", 360, 320, 100, 28, 0) $Launch = GUICtrlCreatePic(@TempDir & "\launch copy.jpg", 96, 344, 100, 28, 0) $Homepage = GUICtrlCreatePic(@TempDir & "\Homepage copy.jpg", 360, 288, 100, 28, 0) $Browser = GUICtrlCreatePic(@TempDir & "\! copy.jpg", 280, 312, 44, 20, 0) $Vote = GUICtrlCreatePic(@TempDir & "\Vote2 copy.jpg", 360, 352, 100, 28, 0) $Statuscheck = GUICtrlCreatePic(@TempDir & "\status button copy.jpg", 256, 352, 100, 28, 0) $Pic8 = GUICtrlCreatePic(@TempDir & "\Select copy.jpg", 80, 288, 196, 20, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Forum Forum() Case $Launch Launch() Case $Homepage HomePage() Case $Vote Vote() Case $Statuscheck StatusCheck() EndSwitch WEnd Func Launch() EndFunc Func HomePage() $oIE = _IECreate ("www.vitalityclan.info") EndFunc But when i click the image nothing happens. I have more funcs i edited the script to be shorter. Thanks in advance.
Authenticity Posted August 10, 2009 Posted August 10, 2009 Because by specifying 0 as the control style you've removed the $SS_NOTIFY style. Either use $SS_NOTIFY or leave this parameter blank: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $hGUI Global $Pic1, $Pic2, $Pic3, $Pic4 $hGUI = GUICreate("Test", 100, 100) $Pic1 = GUICtrlCreatePic("", 0, 0, 50, 50) $Pic2 = GUICtrlCreatePic("", 0, 50, 50, 50) $Pic3 = GUICtrlCreatePic("", 50, 0, 50, 50) $Pic4 = GUICtrlCreatePic("", 50, 50, 50, 50) GUISetState() #region - GUI SwitchLoop While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Pic1 MsgBox(0x40, 'Title', 'Pic1') Case $Pic2 MsgBox(0x40, 'Title', 'Pic2') Case $Pic3 MsgBox(0x40, 'Title', 'Pic3') Case $Pic4 MsgBox(0x40, 'Title', 'Pic4') EndSwitch WEnd #endregion
vi6ora Posted August 10, 2009 Author Posted August 10, 2009 >_< Thanks. Can you tell me why when i click 1 image the func works, but when i try to click another button nothing happens.
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