lowbred Posted March 26, 2015 Share Posted March 26, 2015 Can someone pls explain why the button disappears when gui is minimized..? expandcollapse popup#include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <WindowsConstants.au3> #include <GUICtrlOnHover.au3> #include <GDIPlus.au3> #include <SendMessage.au3> _GDIPlus_Startup() Local $hGUI = GUICreate("Example", 500, 250) ;, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) $Button1 = GUICtrlCreatePic('', 0, 0, 0, 0) _GUICtrl_OnHoverRegister(-1, "_Hover_Proc", "_Leave_Hover_Proc", "PrimaryDown_Proc", "PrimaryUp_Proc") SendImageToPicControl("normal_1.png", $Button1) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 EndSwitch WEnd GUIDelete($hGUI) Func SendImageToPicControl($sImage, $iCtrlID) Local Const $hImage = _GDIPlus_ImageLoadFromFile($sImage) Local Const $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($iCtrlID, 0x0172, $IMAGE_BITMAP, $hHBitmap)) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_ImageDispose($hImage) EndFunc ;==>SendImageToPicControl ;;;;;;;;;;;;;;;;;;;;;;;;;;PNG Button 1;;;;;;;;;;;;;;;;;;;;;;;;;; Func _Hover_Proc($iCtrlID) Switch $iCtrlID Case $Button1 SendImageToPicControl("hover_1.png", $Button1) EndSwitch EndFunc ;==>_Hover_Proc Func _Leave_Hover_Proc($iCtrlID) Switch $iCtrlID Case $Button1 SendImageToPicControl("normal_1.png", $Button1) EndSwitch EndFunc ;==>_Leave_Hover_Proc Func PrimaryDown_Proc($iCtrlID) Switch $iCtrlID Case $Button1 SendImageToPicControl("pressed_1.png", $Button1) EndSwitch EndFunc ;==>PrimaryDown_Proc Func PrimaryUp_Proc($iCtrlID) Switch $iCtrlID Case $Button1 SendImageToPicControl("enabled_1.png", $Button1) EndSwitch EndFunc ;==>PrimaryUp_Proc ;;;;;;;;;;;;;;;;;;;;;;;;;;PNG Button 1;;;;;;;;;;;;;;;;;;;;;;;;;; Link to comment Share on other sites More sharing options...
UEZ Posted March 26, 2015 Share Posted March 26, 2015 (edited) Probably $Button1 = GUICtrlCreatePic('', 0, 0, 0, 0) is the problem. Try to enter a width and a height and you should catch your butt again. Edited March 26, 2015 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
lowbred Posted March 27, 2015 Author Share Posted March 27, 2015 Easy shmeasy Sometimes the simplest explanation is usually the right one. This is my first ever GUI and I'm definitely learnin. Thanks UEZ 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