Iuli Posted September 26, 2009 Share Posted September 26, 2009 (edited) Hi, I'm writing a script that will change the an image when the mouse if over. But it seems it doesn't work. I'm attaching the code below expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "setimage.au3" #include "hover.au3" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 467, 192, 124) $Pic1 = GUICtrlCreatePic("options_logo.jpg", 0, 0, 196, 466) $Pic2 = GUICtrlCreatePic("", 32, 112, 162, 59) ;Yashied UDF _SetImage($Pic2,"performance.png") GUICtrlSetOnHover($Pic2, "HoverPic", "LeaveHoverPic") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func HoverPic ($CtrlID) Select Case $CtrlID=$Pic2 ConsoleWrite("1") ;Yashied UDF _SetImage($Pic2,"performance_over.png") EndSelect EndFunc Func LeaveHoverPic ($CtrlID) Select Case $CtrlID=$Pic2 ConsoleWrite("2") ;Yashied UDF _SetImage($Pic2,"performance.png") EndSelect EndFunc What did i do wrong ?gfx.zip Edited September 26, 2009 by Iuli [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent] Link to comment Share on other sites More sharing options...
Yashied Posted September 26, 2009 Share Posted September 26, 2009 Please attach the all images that uses this code. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Iuli Posted September 26, 2009 Author Share Posted September 26, 2009 Please attach the all images that uses this code.Attached them to the first post [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent] Link to comment Share on other sites More sharing options...
SimonWebstation Posted September 26, 2009 Share Posted September 26, 2009 Can you give me the link to the _SetImage function because I couldn't find it mfg. SimonMany of my answers are translated of google, because I'am from Germany Link to comment Share on other sites More sharing options...
Iuli Posted September 26, 2009 Author Share Posted September 26, 2009 Can you give me the link to the _SetImage function because I couldn't find itHere [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent] Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 Sorry, but I don't have the file setimage.au3 and hover.au3.Can you please attach the files? JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Yashied Posted September 26, 2009 Share Posted September 26, 2009 (edited) Icons.au3 primarily designed for static images. But I made a few changes for you:I changed MrCreatoR's UDF for such tasks. _WinAPI_WindowFromPoint() function not quite suited for this.I wrote the _SetImageHover() function and change your code to avoid flicker when changing images. You do not need Icons.au3.expandcollapse popup#Include <GUICtrlSetOnHover.au3> #Include <GUIConstantsEx.au3> #Include <GDIPlus.au3> Opt('MustDeclareVars', 1) Global $hForm, $Pic1, $hPic1, $Pic2, $hPic2, $nMsg _GDIPlus_Startup() $hForm = GUICreate('Form1', 625, 467, 192, 124) $Pic1 = GUICtrlCreatePic(@ScriptDir & '\options_logo.jpg', 0, 0, 196, 466) $hPic1 = GUICtrlGetHandle($Pic1) GUICtrlSetState(-1, $GUI_DISABLE) $Pic2 = GUICtrlCreatePic('', 32, 112, 162, 59) $hPic2 = GUICtrlGetHandle($Pic2) _SetImageHover($Pic2, @ScriptDir & '\performance.png') GUICtrlSetOnHover($Pic2, 'HoverPic', 'LeaveHoverPic') GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func HoverPic($CtrlID) Select Case $CtrlID = $Pic2 _WinAPI_InvalidateRect($hPic1, _ControlGetRect($hPic2)) _SetImageHover($Pic2, @ScriptDir & '\performance_over.png') _WinAPI_InvalidateRect($hPic2) EndSelect EndFunc ;==>HoverPic Func LeaveHoverPic($CtrlID) Select Case $CtrlID = $Pic2 _WinAPI_InvalidateRect($hPic1, _ControlGetRect($hPic2)) _SetImageHover($Pic2, @ScriptDir & '\performance.png') _WinAPI_InvalidateRect($hPic2) EndSelect EndFunc ;==>LeaveHoverPic Func _ControlGetRect($hWnd) Local $Pos = ControlGetPos($hWnd, '', '') Local $tRect = DllStructCreate('int;int;int;int') DllStructSetData($tRect, 1, $Pos[0]) DllStructSetData($tRect, 2, $Pos[1]) DllStructSetData($tRect, 3, $Pos[0] + $Pos[2]) DllStructSetData($tRect, 4, $Pos[1] + $Pos[3]) Return $tRect EndFunc ;==>_ControlGetRect Func _SetImageHover($ControlID, $sImage) Local $hWnd = GUICtrlGetHandle($ControlID) Local $hImage, $hBitmap ; _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromFile($sImage) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) ; _GDIPlus_Shutdown() _WinAPI_DeleteObject(_SendMessage($hWnd, 0x0173)) _SendMessage($hWnd, 0x0172, 0, $hBitmap) $hImage = _SendMessage($hWnd, 0x0173) If $hImage <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf EndFunc ;==>_SetImageHoverGUICtrlSetOnHover.au3 (Modified)EDIT:Nice GUI you do it. Edited September 26, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 (edited) Why is it that I don't have the au3 files? This line doesn't work for me:#Include <GUICtrlSetOnHover.au3> EDIT:WHERE DID YOU ALL GET THE FILES??? Edited September 26, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 Luli, where did you get the file? I am using the beta version too.. WHERE!?!?! JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Yashied Posted September 26, 2009 Share Posted September 26, 2009 (edited) Why is it that I don't have the au3 files? This line doesn't work for me:#Include <GUICtrlSetOnHover.au3> EDIT: WHERE DID YOU ALL GET THE FILES??? Sorry. See Post #7 Edited September 26, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 Yay!!! Thanks! JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 (edited) Bad news. When I compiled your scripts into a program (the edited version by Yashied), my Avira marked it as VIRUS!!! I think if you continued without changing anything, anti-viruses will continue to mark it as viruses... Then... People won't trust your software... Not joke. No offense. Edited September 26, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
herewasplato Posted September 26, 2009 Share Posted September 26, 2009 Bad news. When I compiled your scripts into a program (the edited version by Yashied), my Avira marked it as VIRUS!!! I think if you continued without changing anything, anti-viruses will continue to mark it as viruses...Then...People won't trust your software...Not joke. No offense.Try compiling it without compression.We know all about false positives from AV tools. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Yashied Posted September 26, 2009 Share Posted September 26, 2009 Bad news. When I compiled your scripts into a program (the edited version by Yashied), my Avira marked it as VIRUS!!! I think if you continued without changing anything, anti-viruses will continue to mark it as viruses...Then...People won't trust your software...Not joke. No offense.I just gave you the source code. Do you really think that I wrote a virus? I suggest you update your antivirus and not ask again the stupid questions. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
herewasplato Posted September 26, 2009 Share Posted September 26, 2009 Rather than edit my own post, just above; I'll make another one and increase my post count. Hint. Hint. http://www.autoitscript.com/forum/index.php?showtopic=34658 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 (edited) I just gave you the source code. Do you really think that I wrote a virus? I suggest you update your antivirus and not ask again the stupid questions.I do not mean something like that, OK?Like I said, NO OFFENSE. I, too, know this is a false positive. I just want to tell him about it. It's fine if you want me to shut up.***Mouth Zipped*** Edited September 26, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Yashied Posted September 26, 2009 Share Posted September 26, 2009 People won't trust your software...Like I said, NO OFFENSE.No offense. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Iuli Posted September 27, 2009 Author Share Posted September 27, 2009 Thank you Yashied ! [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent] Link to comment Share on other sites More sharing options...
Crash Posted September 29, 2009 Share Posted September 29, 2009 Sorry... I should not have say (I mean type) that too... JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ 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