xenium Posted July 9, 2007 Share Posted July 9, 2007 as in places an image, GuiCtrlCreatePic, but also apply a clickable link to that pic, er web link to open into a browser? Thanks you. Link to comment Share on other sites More sharing options...
martin Posted July 10, 2007 Share Posted July 10, 2007 (edited) as in places an image, GuiCtrlCreatePic, but also apply a clickable link to that pic, er web link to open into a browser? Thanks you. #include <guiconstants.au3> $main = GUICreate("picture link") $but = GUICtrlCreateButton("exit",20,20,120,20) $pic = GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",40,90,0,0) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE or $msg = $but Then ExitLoop If $msg = $GUI_EVENT_PRIMARYDOWN Then If HWNDUnderMouse() = GUICtrlGetHandle($pic) Then ShellExecute("http:\\www.autoitscript.com") EndIf WEnd Func HWNDUnderMouse() ;by Larry Local $point, $hwnd $point = MouseGetPos() If @error Then Return SetError(1,0,0) $hwnd = DLLCall("user32.dll", "hwnd", "WindowFromPoint", "int", $point[0], "int", $point[1]) If Not @error Or $hwnd[0] <> 0 Then Return $hwnd[0] Return SetError(2,0,0) EndFunc EDIT: This is silly - see my later post with thanks to smashly for pointing it out. Edited July 10, 2007 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
smashly Posted July 10, 2007 Share Posted July 10, 2007 (edited) Thank you martin , that's quite .. erm quite extravagant .. Is there something a bit simpler and shorter to get the same end result ?.. Cheers Edited July 10, 2007 by smashly Link to comment Share on other sites More sharing options...
martin Posted July 10, 2007 Share Posted July 10, 2007 Thank you martin , that's quite .. erm quite extravagant .. Is there something a bit simpler and shorter to get the same end result ?.. Cheers Oh thanks smashly, I converted a previous post and forget to engage my brain :"> This is a bit more sensible #include <guiconstants.au3> $main = GUICreate("picture link") $but = GUICtrlCreateButton("exit",20,20,120,20) $pic = GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",40,90,0,0) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $but Or $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg= $pic Then ShellExecute("http:\\www.autoitscript.com") WEnd Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
smashly Posted July 10, 2007 Share Posted July 10, 2007 (edited) I don't think the first example was silly at all, I thought it was quite clever actually (in a round about kind of way) Thank you for the shorter version as the first version actually made me think .. ouch for my brain Cheers Edited July 10, 2007 by smashly Link to comment Share on other sites More sharing options...
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