Jump to content

AppTux

Active Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by AppTux

  1. I want to make a program to add or remove users. Is it possible to read all the users from the computer and set it in a combo?
  2. I've found by my own a solution. Now I use vars like this: #include <GUIConstants.au3> #include <ModernMenuRaw.au3> #NoTrayIcon $Item1Inf = 1 ;Item 1 is checked $Item2Inf = 0 ;Item 2 is checked $GUI = GUICreate("My GUI") $Menu1 = GUICtrlCreateMenu("MyMenu1") $MenuItem1 = _GUICtrlCreateODMenuItem("Number 1",$Menu1,"",0,1) ;Create a menu Item with a radio GUICtrlSetState($MenuItem1,$GUI_CHECKED) $MenuItem2 = _GUICtrlCreateODMenuItem("Number 2",$Menu1,"",0,1) SetColors() $Button1 = GUICtrlCreateButton("Click Me!",40,100,200,50) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Item1Inf = 1 Then MsgBox(0,"Information","$MenuItem1 is checked") ElseIf $Item2Inf = 1 Then MsgBox(0,"Information","$MenuItem2 is checked") Else MsgBox(16,"Information","Nothing is checked!!!") EndIf Case $MenuItem1 $Item1Inf = 1 $Item2Inf = 0 GUICtrlSetState($MenuItem1,$GUI_CHECKED) GUICtrlSetState($MenuItem2,$GUI_UNCHECKED) Case $MenuItem2 $Item1Inf = 0 $Item2Inf = 1 GUICtrlSetState($MenuItem2,$GUI_CHECKED) GUICtrlSetState($MenuItem1,$GUI_UNCHECKED) EndSwitch WEnd Func SetColors() _SetMenuBkColor(0xFFFFFF) _SetMenuIconBkColor(0xFFEFE3) _SetMenuIconBkGrdColor(0xE4AD87) _SetMenuSelectBkColor(0xC2EEFF) _SetMenuSelectRectColor(0x800000) _SetMenuSelectTextColor(0x000000) _SetMenuTextColor(0x000000) EndFunc Sorry for that unnecessary topic. I'll try to look first good at my script and find a solution before I start a topic.
  3. I´ve got a script with a menu used ModernMenuRaw.au3. http://www.autoitscript.com/forum/index.php?showtopic=20967 I want to read a menuitem. There´s no function added. I tried GUICtrlRead(), but that doesn't work. How can I read these? #include <GUIConstants.au3> #include <ModernMenuRaw.au3> #NoTrayIcon $GUI = GUICreate("My GUI") $Menu1 = GUICtrlCreateMenu("MyMenu1") $MenuItem1 = _GUICtrlCreateODMenuItem("Number 1",$Menu1,"",0,1) ;Create a menu Item with a radio GUICtrlSetState($MenuItem1,$GUI_CHECKED) $MenuItem2 = _GUICtrlCreateODMenuItem("Number 2",$Menu1,"",0,1) SetColors() $Button1 = GUICtrlCreateButton("Click Me!",40,100,200,50) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 $Item1Inf = GUICtrlRead($MenuItem1) $Item2Inf = GUICtrlRead($MenuItem2) If $Item1Inf = 1 Then MsgBox(0,"Information","$MenuItem1 is checked") ElseIf $Item2Inf = 0 Then MsgBox(0,"Information","$MenuItem2 is checked") Else MsgBox(16,"Information","Nothing is checked!!!") EndIf Case $MenuItem1 GUICtrlSetState($MenuItem1,$GUI_CHECKED) GUICtrlSetState($MenuItem2,$GUI_UNCHECKED) Case $MenuItem2 GUICtrlSetState($MenuItem2,$GUI_CHECKED) GUICtrlSetState($MenuItem1,$GUI_UNCHECKED) EndSwitch WEnd Func SetColors() _SetMenuBkColor(0xFFFFFF) _SetMenuIconBkColor(0xFFEFE3) _SetMenuIconBkGrdColor(0xE4AD87) _SetMenuSelectBkColor(0xC2EEFF) _SetMenuSelectRectColor(0x800000) _SetMenuSelectTextColor(0x000000) _SetMenuTextColor(0x000000) EndFunc
  4. i try several ways, but it doesn't work good and fast. if the script has to ping, it's during a long time (sometimes 10 seconds) that's too long. i use the default windows error message...
  5. Hello all, I have a script that runs a program, open an folder or file or open a internet adress. i use ShellExecute() I want to make a own error if it doesn't exists. i've got this: ShellExecute($rVAR) ;$rVAR is the request of a gui control with GUICtrlRead() If @error Then MsgBox(16,"Error","WindowsRun 1.0 can't find "& $rVAR &". Make sure it's a working internet adress or"&@CRLF&"use the browse button to browse to a file.") EndIf With this script first comes the windows default error window, and then my own error. how have i to do this?
  6. Maybe you can use a button #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> $GUI = GUICreate("Example",300,300,-1,-1,$WS_POPUP) ;GUI $Button1 = GUICtrlCreateButton("_",5,5) ;Minimize button GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $Button1 GUISetState(2) ;This is minimize EndSwitch WEnd I hope this is where you are looking for
  7. Melba23, That's what I wanted to hear. I go look for the solution of the problem. Maybe I have to look the solution in the drivers of my graphic card. I really don't know...
  8. I have this now: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: Gert-Jan van Ginkel Name: WindowsTools Run Script Function: Run a program and open a folder, document or Internet Adress. #ce ---------------------------------------------------------------------------- #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> $WST = "Normal" ;The other GUI is not opened $GUI = GUICreate("WindowsTools",300,180) GUISetBkColor(0xFFFFFF) $bEXP = GUICtrlCreateButton("<<",0,155,25,25) GUISetState() Do $Msg = GUIGetMsg() Switch $Msg Case $bEXP If $WST = "Normal" Then ;If the other GUI isn't opened. GUICtrlSetData($bEXP,">>") $GUI2 = GUICreate("",150,180,-152,25,$WS_POPUP,$WS_EX_MDICHILD,$GUI) GUISetBkColor(0xFFFFFF) GUICtrlCreatePic("Data\bk.bmp",0,0,150,180) GUICtrlSetState(-1,$GUI_DISABLE) ; TREEVIEW ONE $TREE = GUICtrlCreateTreeView(5, 5, 140, 170) $TREEI1 = GUICtrlCreateTreeViewItem("WindowsTools", $TREE) $T1RUN = GUICtrlCreateTreeViewItem("Run", $TREEI1) $T1TCL = GUICtrlCreateTreeViewItem("Temp Cleaner",$TREEI1) $TREEI2 = GUICtrlCreateTreeViewItem("Options", $TREE) $T2RUN = GUICtrlCreateTreeViewItem("Run Options",$TREEI2) GUICtrlSetState($TREEI1, $GUI_EXPAND) GUICtrlSetState($TREEI2 ,$GUI_EXPAND) GUISetState() $WST = "Expanded" ;Set the value to Expanded so if you again press the button the GUI will be deleted. ElseIf $WST = "Expanded" Then ;If the other GUI is opened. GUICtrlSetData($bEXP,"<<") GUIDelete($GUI2) $WST = "Normal" ;Set the value to Normal so if you again press the button the GUI will be created again. EndIf EndSwitch Until $Msg = $GUI_EVENT_CLOSE I hope you can understand it now better. The child windows works, but i have a really strange result: do you have the same result? because it does not matter what I want
  9. Sorry for that strange script. I have now school holiday so I go to rewrite the script. And change some things so you can understand it much more But the rewriting can during a long, long time with a lot of bugs.
  10. GUICtrlCreateButton("Button1",20,20,20,15,-1) ;so you can see the button GUICtrlSetState(-1,$GUI_DISABLE) ;this disables the button GUICtrlSetState(-1,$GUI_ENABLE) ;this will enable the button
  11. I have a gui. if you press a button, then opens a new gui. now, the problem is, if you move the gui and the small gui is open, then the small gui have to go with the normal gui. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: AppTux Script Function: Run a program and open a folder, document or Internet Adress. #ce ---------------------------------------------------------------------------- #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIEdit.au3> #include <File.au3> Opt('MustDeclareVars', 1) _WindowsTools_Run() Func _WindowsTools_Run() Local $GUI,$GUIP,$pBAN,$pMIN,$pMIN2 Local $Msg,$MOV,$ST = 0,$STW = 0 Local $WINP,$LOCGUI,$lWT,$lRUN,$lRNO,$lROP $GUI = GUICreate("WindowsTools Run",300,190) $GUIP = WinGetPos($GUI) GUISetIcon("WindowsTools.ico",1,$GUI) GUISetBkColor(0xFFFFFF,$GUI) GUICtrlCreatePic("Data\Images\bk.bmp",0,20,300,170) GUICtrlSetState(-1,$Gui_Disable) ;------------------------------------------------Begin of Controls---------------------------------; $pBAN = GUICtrlCreatePic("Data\Images\banner_run.bmp",0,0,300,20) $pMIN = GUICtrlCreatePic("Data\Images\expand1.bmp",5,165,20,20) $pMIN2 = GUICtrlCreatePic("Data\Images\min1.bmp",5,165,20,20) GUICtrlSetState($pMIN2,$GUI_HIDE) GUISetState() While 1 $Msg = GUIGetMsg($GUI) $MOV = GUIGetCursorInfo($GUI) $WINP = WinGetPos($GUI) If $Msg = $GUI_EVENT_CLOSE Then Exit EndIf If $MOV[4] = $pMIN Then If $STW = 0 Then GUISetState(@SW_SHOW,$GUI) GUICtrlDelete($pMIN) $pMIN = GUICtrlCreatePic("Data\Images\expand2.bmp",5,165,20,20) GUICtrlSetState($pMIN,$GUI_SHOW) GUISetState(@SW_SHOW,$LOCGUI) While $MOV[4] = $pMIN $Msg = GUIGetMsg() If $Msg = $pMIN Then GUICtrlSetState($pMIN2,$GUI_SHOW) $WINP = WinGetPos($GUI) $LOCGUI = GUICreate("Locations",150,188,$WINP[0] -150,$WINP[1] +28,$WS_POPUP,"",$GUI) GUISetIcon("WindowsTools.ico",1,$LOCGUI) GUISetBkColor(0xffffff,$LOCGUI) GUICtrlCreatePic("Data\Images\bk.bmp",0,0,150,188) GUICtrlCreatePic("Data\Images\treeexpand.bmp",5,6,9,9) $lWT = GUICtrlCreateLabel("WindowsTools",20,5,70,15) GUICtrlCreatePic("Data\Images\treeexpand.bmp",15,23,9,9) $lRUN = GUICtrlCreateLabel("Run",30,22,50,15) GUICtrlCreateIcon("WindowsTools.ico",1,20,37,16,16) $lRNO = GUICtrlCreateLabel("Run",40,39,50,15) GUICtrlCreateIcon("WindowsToolsOpt.ico",1,20,56,16,16) $lROP = GUICtrlCreateLabel("Options",40,58,60,15) GUISetState() GUICtrlSetState($pMIN,$GUI_HIDE) $STW = 1 EndIf $MOV = GUIGetCursorInfo($GUI) Sleep(50) WEnd If $STW = 0 Then GUISetState(@SW_SHOW,$GUI) GUICtrlDelete($pMIN) $pMIN = GUICtrlCreatePic("Data\Images\expand1.bmp",5,165,20,20) GUICtrlSetState($pMIN,$GUI_SHOW) GUISetState(@SW_SHOW,$LOCGUI) ElseIf $STW = 1 Then GUICtrlSetState($pMIN,$GUI_HIDE) EndIf ElseIf $STW = 1 Then ; EndIf EndIf WEnd EndFunc not all of the functions work, but i can expand the gui i hope i give enough information
  12. do you mean a background color of a input control?
  13. You can try this: $label1 = GUICtrlCreateLabel("Example",0,0,50,20) GUICtrlSetBkColor($label1(0xd8d8d8) ;a light grey color But you can also search in the help file.
  14. I stop with that. i go do it with a single small browse button
  15. no, unfortanely not. but the full resources and data are in the .zip archive. maybe can that help.
  16. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: AppTux Script Function: Run a program and open a folder, document or Internet Adress. #ce ---------------------------------------------------------------------------- #NoTrayIcon #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GUIEdit.au3> #include <File.au3> Opt('MustDeclareVars', 1) XRUN() Func XRUN() Local $A1[26],$GUI1,$pSD,$pNORM,$pNORM2,$pOPT,$pOPT2,$tBAN,$tEXP,$cINP,$bOK,$bCAN,$bBRO,$cINP2 Local $msg,$rINF,$rBIN,$ST = 0,$inpVAR If FileExists("Data\Xtreme.xdata") Then ; Else MsgBox(16,"Error","The data file doesn't exists."& @CRLF &"Please install again!") Exit EndIf _FileReadToArray("Data\Xtreme.xdata",$A1) $GUI1 = GUICreate("Xtreme Run 1.01 bèta",$A1[2], $A1[3],-1,-1) GUISetBkColor(0xffffff,$GUI1) ;----------------------------------------Side tabs-------------------------------------------------; $pSD = GUICtrlCreatePic("Data\Images\side.bmp",0,60,30,$A1[3]) $pNORM = GUICtrlCreatePic("Data\Images\side-normal1.bmp",0,0,30,30) $pNORM2 = GUICtrlCreatePic("Data\Images\side-normal2.bmp",0,0,30,30) $pOPT = GUICtrlCreatePic("Data\Images\side-options1.bmp",0,30,30,30) $pOPT2 = GUICtrlCreatePic("Data\Images\side-options2.bmp",0,30,30,30) ;----------------------------------------Normal controls-------------------------------------------; $tBAN = GUICtrlCreateLabel("Xtreme Run",$A1[5],$A1[6],260,40) GUICtrlSetFont($tBAN,12) $tEXP = GUICtrlCreateLabel("Type a program, document, folder or Internet Adress,"& @CRLF &"and Xtreme Run will open it for you",40,50) $cINP = GUICtrlCreateInput("",40,85,250,20) $bOK = GUICtrlCreateButton("OK",$A1[9],$A1[10],$A1[12],$A1[13]) $bCAN = GUICtrlCreateButton("Cancel",$A1[15],$A1[16],$A1[18],$A1[19]) $bBRO = GUICtrlCreateButton("Browse...",$A1[21],$A1[22],$A1[24],$A1[25]) ;----------------------------------------Options controls------------------------------------------; $cINP2 = GUICtrlCreateInput("",40,85,100,20) ;----------------------------------------Set state of GUICtrls-------------------------------------; GUICtrlSetState($pNORM2,$GUI_HIDE) GUICtrlSetState($pOPT,$GUI_HIDE) GUICtrlSetState($cINP2,$GUI_HIDE) ;----------------------------------------End of controls and setting state of controls-------------; GUISetState() Do GUISetState() $msg = GUIGetMsg() $rINF = _GUICtrlEdit_GetText($cINP) If GUICtrlGetState($bOK) = 144 Then If $rINf <> "" Then GUICtrlSetState($bOK, $GUI_ENABLE) GUICtrlSetState($bOK, $GUI_DEFBUTTON) EndIf ElseIf GUICtrlGetState($bOK) = 80 Then If $rINF = "" Then GUICtrlSetState($bOK, $GUI_DISABLE) EndIf EndIf If $msg = $pNORM2 Then If $ST = 0 Then ; ElseIf $ST = 1 Then ;-------------------------Set state of images-----------------------------; GUICtrlSetState($pNORM,$GUI_SHOW) GUICtrlSetState($pNORM2,$GUI_HIDE) GUICtrlSetState($pOPT,$GUI_HIDE) GUICtrlSetState($pOPT2,$GUI_SHOW) ;-------------------------Set state of controls----------------------------; GUICtrlSetState($cINP2,$GUI_HIDE) GUICtrlSetData($cINP,$inpVAR) GUICtrlSetState($cINP,$GUI_SHOW) GUICtrlSetData($tBAN,"Xtreme Run") GUICtrlSetState($tEXP,$GUI_SHOW) $ST = 0 EndIf ElseIf $msg = $pOPT2 Then If $ST = 1 Then ; ElseIf $ST = 0 Then ;-------------------------Set state of images-----------------------------; GUICtrlSetState($pNORM,$GUI_HIDE) GUICtrlSetState($pNORM2,$GUI_SHOW) GUICtrlSetState($pOPT,$GUI_SHOW) GUICtrlSetState($pOPT2,$GUI_HIDE) ;-------------------------Set state of controls----------------------------; GUICtrlSetState($cINP,$GUI_HIDE) GUICtrlSetData($tBAN,"Options") GUICtrlSetState($tEXP,$GUI_HIDE) GUICtrlSetState($cINP2,$GUI_SHOW) $inpVAR = _GUICtrlEdit_GetText($cINP) GUICtrlSetData($cINP,"-") $ST = 1 EndIf ElseIf $msg = $bOK Then If $ST = 0 Then Sleep(100) ShellExecute($rINF) ElseIf $ST = 1 Then ; EndIf ElseIf $msg = $bCAN Then Exit ElseIf $msg = $bBRO Then If $ST = 0 Then $rBIN = FileOpenDialog("Browse...",@DesktopDir,"All Files (*.*)") GUICtrlSetData($cINP,$rBIN) ElseIf $ST = 1 Then ; EndIf EndIf Until $msg = $GUI_EVENT_CLOSE EndFunc The second input is to import another .xdata file so you can change the dimensions and other things
  17. is there a function that if you select a gui input that you can change a var? i need this because i have a gui with a browse button, and if you select the first input, then changes it a var. And if you select a other input, then changes it the var to another value If the var is 1, then goes it do something else than if the var is 2 is this possible (i hope that i explain it good enough )
  18. I am also a newbie, so i can't answer very good, but i think it isn't possible. but you can make a little gui that contains 2 buttons. like this #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Opt("MustDeclareVars",1) Function1() Func Function1() Local $Button1,$Button2,$Button3,$Msg GUICreate("Form1",200,50,@DesktopWidth -200,0,$WS_POPUP) ;You can replace this with images, the same thing happen $Button1 = GUICtrlCreateButton("Minimize",0,0,100,25) ;You can make the buttons bigger for the touchscreen $Button2 = GUICtrlCreateButton("Close",100,0,100,25) $Button3 = GUICtrlCreateButton("Close window",0,25,200,25) GUISetState() Do GUISetState() ;Set always the window on top $Msg = GUIGetMsg() If $Msg = $Button1 Then ;command to minimize the program ElseIf $Msg = $Button2 Then ;command to close the program ElseIf $Msg = $Button3 Then Exit EndIf Until $Msg = $GUI_EVENT_CLOSE EndFunc
  19. I understand that not really, but that is not where i was looking for but thanks for your fast reply
  20. sorry, the uploading doesn't work
  21. I had update the code a bit. maybe can you see the problem. The new problem (not a very big) is a bit smaller. the image change when i go over the image, but the normal also. it's flashing. but if i leave the button, the images flashes not on. (own problem resolved) #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <File.au3> #Include <GUICtrlSetOnHover.au3> #Include <Icons.au3> Global $pressed = 0,$theme[6] _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Xtreme Run", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) _GUICtrl_SetOnHover(-1, "_Hover_Proc", "_Leave_Hover_Proc", "PrimaryDown_Proc", "PrimaryUp_Proc") $min2 = GUICtrlCreatePic("Resources\min-hover.bmp",375,0,25,18) $min3 = GUICtrlCreatePic("Resources\min-press.bmp",375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) GUICtrlSetState($min,$GUI_SHOW) GUICtrlSetState($min2,$GUI_HIDE) GUICtrlSetState($min3,$GUI_HIDE) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Hover_Proc($iCtrlID) Switch $iCtrlID Case $min GUICtrlSetState($min,$GUI_HIDE) GUICtrlSetState($min3,$GUI_HIDE) GUICtrlSetState($min2,$GUI_SHOW) $pressed = 1 EndSwitch EndFunc Func _Leave_Hover_Proc($iCtrlID) Switch $iCtrlID Case $min GUICtrlSetState($min,$GUI_SHOW) GUICtrlSetState($min2,$GUI_HIDE) GUICtrlSetState($min3,$GUI_HIDE) $pressed = 2 EndSwitch EndFunc Func PrimaryDown_Proc($iCtrlID) Switch $iCtrlID Case $min If $pressed = 1 Then GUICtrlSetState($min,$GUI_HIDE) GUICtrlSetState($min2,$GUI_HIDE) GUICtrlSetState($min3,$GUI_SHOW) $pressed = 2 EndIf EndSwitch EndFunc Func PrimaryUp_Proc($iCtrlID) Switch $iCtrlID Case $min If $pressed = 2 Then GUICtrlSetState($min,$GUI_SHOW) GUICtrlSetState($min2,$GUI_HIDE) GUICtrlSetState($min3,$GUI_HIDE) $pressed = 1 WinSetState($GUI1, "", @SW_MINIMIZE) EndIf EndSwitch EndFunc All of the things i need are in the file. (or what you need) maybe it can help troubleshooting
  22. #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <File.au3> #Include <GUICtrlSetOnHover.au3> #Include <Icons.au3> Global $pressed = 0,$theme[6] _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Xtreme Run", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) _GUICtrl_SetOnHover(-1, "_Hover_Proc", "_Leave_Hover_Proc", "PrimaryDown_Proc", "PrimaryUp_Proc") $close = GUICtrlCreatePic($theme[5],400,0,50,18) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Hover_Proc($iCtrlID) Switch $iCtrlID Case $min GUICtrlDelete($min) $min = GUICtrlCreatePic("Resources\min-hover.bmp",375,0,25,18) GUICtrlSetState(-1,$GUI_SHOW) $pressed = 1 EndSwitch EndFunc Func _Leave_Hover_Proc($iCtrlID) Switch $iCtrlID Case $min GUICtrlDelete($min) $min = GUICtrlCreatePic("Resources\min.bmp",375,0,25,18) GUICtrlSetState(-1,$GUI_SHOW) $pressed = 2 EndSwitch EndFunc Func PrimaryDown_Proc($iCtrlID) Switch $iCtrlID Case $min If $pressed = 1 Then GUICtrlDelete($min) GUICtrlCreatePic("Resources\min-press.bmp",375,0,25,18) GUICtrlSetState(-1,$GUI_SHOW) $pressed = 2 EndIf EndSwitch EndFunc Func PrimaryUp_Proc($iCtrlID) Switch $iCtrlID Case $min If $pressed = 2 Then GUICtrlDelete($min) $pressed = 1 WinSetState($GUI1, "", @SW_MINIMIZE) $min = GUICtrlCreatePic("Resources\min.bmp",375,0,25,18) GUICtrlSetState(-1,$GUI_SHOW) EndIf EndSwitch EndFunc Only the mouseover action works. the image wouldn't change when I leave the button.
  23. I have a GUI with a close and a minimize button. In a other topic had i see a way to do it. I want to press the minimize or closebutton, and if you go up with your mouse button then goes it do something. I have that code something modified, but it doesn't work #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <File.au3> #Include <GUICtrlSetOnHover.au3> #Include <Icons.au3> Global $Back,$theme[6],$Hold = False _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Example", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) $Back = GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) For $i = $min To $close _Leave($i) Next GUISetState() Do $msg = GUIGetMsg() $cursor = GUIGetCursorInfo($GUI1) Until $msg = -3 Func _Down($CtrlID) If $Hold Then Return Else $Hold = True EndIf Local $File Switch $CtrlID Case $min $File = 'min-press.bmp' Case $close $File = 'close-press.bmp' EndSwitch _SetImage($CtrlID, @ScriptDir & '\Resources\' & $File, $Back) EndFunc ;==>_Down Func _Leave($CtrlID) Local $File Switch $CtrlID Case $min $File = 'min.bmp' Case $close $File = 'close.bmp' EndSwitch _SetImage($CtrlID, @ScriptDir & '\Resources\' & $File, $Back) $Hold = False EndFunc ;==>_Leave Func _Hover($CtrlID) Local $File Switch $CtrlID Case $min $File = 'min-hover.bmp' Case $close $File = 'close-hover.bmp' EndSwitch _SetImage($CtrlID, @ScriptDir & '\Resources\' & $File, $Back) $Hold = False EndFunc ;==>_Hover Func _Up($CtrlID) _Hover($CtrlID) EndFunc ;==>_Up Can you see what te problem is with this code?? plz help me.
  24. Thanks, it works very well. also thanks for the welcome this is very useful, also for the minimize button and other things in my GUI AppTux
  25. I want more than three pictures in a GUI. When I try this, i only can see three pictures. I have a GUI that contains a minimize and close button and a button. The close and minimize button 're pictures. the bar also. when i click the close button, you have to see an other picture. But not. I only see a white picture, not I want to see. plz help me!! #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiMenu.au3> #include <File.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $theme[6],$GUI1,$inp,$min,$close,$msg,$cursor _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Example", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) $inp = GUICtrlCreateButton("Click on Me!",20,100,200,20) GUISetState() Do $msg = GUIGetMsg() $cursor = GUIGetCursorInfo($GUI1) If $msg = $close Then GUICtrlDelete($close) GUICtrlCreatePic($theme[6],255,0,20,20) Sleep(100) Exit EndIf Until $msg = $GUI_EVENT_CLOSE EndFunc
×
×
  • Create New...