Flok3r Posted April 27, 2011 Share Posted April 27, 2011 Why this new topic?no solutions or valuable information So, i could absolutely not figure out why the current window (firefox, openoffice, whatever) sometime loses focus, when i press tab (not shift+tab) or the right arrow key, though i havent even set those keys as ispressed trigger.here my script as a whole, the ispressed part is in the lines 104 and 112.simply compile it, execute it and try to press tab in ff.thanks in advance, this really annoys me.ps: you can show the gui with mouse key 1 and 2 pressed simultaniously (the first ispressed func).expandcollapse popup#region base part #AutoIt3Wrapper_icon=icon.ico #AutoIt3Wrapper_Res_Language=1036 #AutoIt3Wrapper_Res_Icon_Add=icon.ico #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GuiButton.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #Include <File.au3> #include <array.au3> #include <FTPEx.au3> #include <Misc.au3> #include <Constants.au3> #include <GuiListView.au3> ;Custom UDFs #Include <Icons.au3> #include <hotstring.au3> #include <ID3.au3> #RequireAdmin #NoTrayIcon Global $buttonpng = @TempDir & "\MyTool\Button.png" Global $dev, $disk, $msg, $infolabel, $tab3editmyscript, $tab3check2, $tab3check3 Global $mrp, $mrf, $mrs, $mrm, $all[1], $links Global $tab, $tab0, $tab0input, $tab3check1, $tab3input, $tab2input Global $tab1, $tab1combo, $tab1OK, $tab0mirrorsd, $base, $basefile, $notes Global $tab2, $tab2OK, $msg, $tab3, $tab0input2, $applymbr, $tab3check4 Global $mrpfile, $mrffile, $tab0showoptions, $vbootlaunch, $tab0proceed Global $tab0listonly, $refresh, $mr, $scriptdir, $mirrorsd, $tab3check1, $tab5 Global $mbr1, $mbr2, $mbr3, $mbr1options, $tab0check1, $tab4editbuild, $tab0showoptionsmbr Global $tab4, $tab4input, $makeportable, $tab4check1, $tab0combo, $tab0combo2, $title Global $tab0input1, $tab0input2, $tab0input3, $tab1input, $tab1check1, $tab1showoptions Global $tab2showoptionsmbr, $tab2check1, $tab2input, $tab2input2, $tab3check1, $tab4input Global $tab4check2, $tab4check3, $ccleaner, $y2m, $cmd, $link1, $link2, $link3, $link4, $link5 Global $linkall, $url1, $url2, $url3, $url4, $url5, $tab3check0, $regonly, $tab3check0lab Global $tab3check5lab, $tab3check1lab, $tab3check2lab, $tab3check3lab, $tab3check4lab Global $mirrorxfiles, $mirrorxfolders, $mytool, $box, $exit, $mirror, $autostart, $mode, $session, $count, $list If WinExists('MyTool by Flok3r') Then Exit DirCreate(@TempDir & "\MyTool") FileInstall("Pictures\Button.png", @TempDir & '\MyTool\', 1) FileInstall("bootlace.com", @TempDir & '\MyTool\', 1) FileInstall("bootsect.exe", @TempDir & '\MyTool\', 1) FileInstall("CCleaner.exe", @TempDir & '\MyTool\', 1) FileInstall("devcon.exe", @TempDir & '\MyTool\', 1) FileInstall("FastYoutube2Mp3.exe", @TempDir & '\MyTool\', 1) FileInstall("Mirror.exe", @TempDir & '\MyTool\', 1) ;FileInstall("7za.exe", @TempDir & '\MyTool\', 1) $dll = DllOpen("user32.dll") If $CmdLine[0] > 0 Then Switch $CmdLine[1] Case "-autostart" call("guifuntion", True) EndSwitch Else Call("guifunction") EndIf #endregion Func Guifunction($hidden = False) HotStringSet("tfzwei", "tfzwei") HotStringSet("portaltwo", "portaltwo") $x = RegRead('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'x-pos') $y = RegRead('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'y-pos') $list = ProcessList(@ScriptName) If $list[0][0] > 1 or $hidden = True Then $hGUI = GUICreate("MyTool by Flok3r", 470,115, @DesktopWidth, @DesktopHeight,$WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST);In order to start silently Else $hGUI = GUICreate("MyTool by Flok3r", 470, 115, $x, $y,$WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) EndIf ;Buttons $exit = custom_button("X", 400, 0, 13, 3, 0xFFFFFF, 70) $settings = custom_button("?", 320, 0, 13, 3, 0xFFFFFF, 70) ;First column $dev = custom_button("Devicemanagement", 0, 30) $y2m = custom_button("Youtube2Mp3", 0, 60) $mbr = custom_button("MBR", 0, 90) ;Second column $cmd = custom_button("Commandline", 160, 30) $myfortune = custom_button("MyFortune", 160, 60) $mirror = custom_button("Mirror Bases", 160, 90) ;Third column $disk = custom_button("Diskmanagement", 320, 30) $ccleaner = custom_button("CleverCleaner", 320, 60) $mymusic = custom_button("MyMusic", 320, 90) GUISetBkColor(0x01, $hGUI) ;For Transparency _WinAPI_SetLayeredWindowAttributes($hGUI, 0x01, 0xFF, 3) ;WinSetTrans("MyTool by Flok3r","",200) GUISetState() ;End of Gui definition If $list[0][0] > 1 Or $hidden = True Then GUISetState(@SW_HIDE) WinMove('MyTool by Flok3r', '',RegRead('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'x-pos'), RegRead('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'y-pos')) EndIf While 1 If _IsPressed("01",$dll) And _IsPressed("02",$dll) Then $mouse = MouseGetPos() WinMove('MyTool by Flok3r', '',($mouse[0] - 235), ($mouse[1] - 138)) Call('guiset', 'show') EndIf If Not WinActive('MyTool by Flok3r') Then Call('guiset', 'hide') If _IsPressed("01",$dll) And _IsPressed("70",$dll) Then Call('exitfunc') $msg = GUIGetMsg() Select Case $msg = $myfortune call("getdrive") If $base Then Run($base & '\MyCode\MyFortune\MyFortune.exe') Else MsgBox(0,"Error","You have to connect a Base FS in order to perform this operation.",6) EndIf Case $msg = $mbr GUIDelete() ShellExecute(@ScriptFullPath) Call('mbr') Exit Case $msg = $mirror GUIDelete() ShellExecute(@ScriptFullPath) Call('mirror') Exit Case $msg = $mymusic GUIDelete() ShellExecute(@ScriptFullPath) Call('mymusic') Exit Case $msg = $ccleaner Run('"' & @TempDir & '\MyTool\CCleaner.exe"') Case $msg = $cmd Run('"' & @WindowsDir & '\system32\cmd.exe') Case $msg = $exit Call('exitfunc') Case $msg = $dev Run(@comspec & " /c " & '%systemdrive%\Windows\System32\devmgmt.msc', "", @SW_HIDE) Case $msg = $disk Run(@comspec & " /c " & '%systemdrive%\Windows\System32\diskmgmt.msc', "", @SW_HIDE) Case $msg = $y2m Run('"' & @TempDir & '\MyTool\FastYoutube2Mp3.exe"') EndSelect WEnd EndFunc ;___________________________________________________________________________________________________________________ Func mirror() Call('getdrive') If $base Then $mirror = GUICreate("Mirror", 500, 200, -1, -1,$WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) $exit = custom_button("X", 50, 0, 13, 3, 0xFFFFFF, 50) $move = GUICtrlCreatePic( "",0,0,50,25,-1,$GUI_WS_EX_PARENTDRAG) ;extended style enables window moving _SetImage(-1, $buttonpng) GUICtrlCreateLabel("Move",0,5,50,25, $SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;Makes the label transparent, so that it wont cover the pic GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetFont(-1,8.5) $left = GUICtrlCreateList("",0,30,50,70) If $mrs Then GUICtrlSetData($left, "MRS","MRS") If $mrm Then GUICtrlSetData($left, "MRM","MRM") If $mrp Then GUICtrlSetData($left, "MRP","MRP") If $mrf Then GUICtrlSetData($left, "MRF","MRF") $right = GUICtrlCreateList("",50,30,50,70) If $mrf Then GUICtrlSetData($right, "MRF","MRF") If $mrp Then GUICtrlSetData($right, "MRP","MRP") If $mrm Then GUICtrlSetData($right, "MRM","MRM") If $mrs Then GUICtrlSetData($right, "MRS","MRS") $way = custom_button("", 0, 94, 13, 3, 0xFFFFFF,100,25) $way_l = GUICtrlCreateLabel("->",33,99,34,25,$SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;Makes the label transparent, so that it wont cover the pic GUICtrlSetColor(-1, 0xFFFFFF) $left_selection_l = GUICtrlCreateLabel("",0,99,50,25,$SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;Makes the label transparent, so that it wont cover the pic GUICtrlSetColor(-1, 0xFFFFFF) $right_selection_l = GUICtrlCreateLabel("",50,99,50,25,$SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;Makes the label transparent, so that it wont cover the pic GUICtrlSetColor(-1, 0xFFFFFF) ;to refresh selection labels before item has been pressed $selection = GUICtrlRead($left) Select Case $selection = "MRF" GUICtrlSetData($left_selection_l, $mrf) Case $selection = "MRP" GUICtrlSetData($left_selection_l, $mrp) Case $selection = "MRM" GUICtrlSetData($left_selection_l, $mrm) Case $selection = "MRS" GUICtrlSetData($left_selection_l, $mrs) EndSelect $selection = GUICtrlRead($right) Select Case $selection = "MRF" GUICtrlSetData($right_selection_l, $mrf) Case $selection = "MRP" GUICtrlSetData($right_selection_l, $mrp) Case $selection = "MRM" GUICtrlSetData($right_selection_l, $mrm) Case $selection = "MRS" GUICtrlSetData($right_selection_l, $mrs) EndSelect $proceed = custom_button("Proceed", 0, 124,8.5, 5, 0xFFFFFF,100,25) $ffs = custom_button("FFS", 0, 154,8.5, 5, 0xFFFFFF,100,25) GUISetBkColor(0x01, $mirror) ;For Transparency _WinAPI_SetLayeredWindowAttributes($mirror, 0x01, 0xFF, 3) GUISetState() ;End of Gui definition While 1 $msg = GUIGetMsg() Select Case $msg = $ffs If GUICtrlRead($way_l) = "->" Then $dest = GUICtrlRead($right_selection_l) $source = GUICtrlRead($left_selection_l) ElseIf GUICtrlRead($way_l) = "<-" Then $source = GUICtrlRead($right_selection_l) $dest = GUICtrlRead($left_selection_l) EndIf If $source <> $dest Then ProcessClose("FreeFileSync.exe") Run($base & '\_MyApps\FreeFileSync\FreeFileSync.exe') WinWaitActive("[CLASS:wxWindowClassNR]","",5) ControlSetText("FreeFileSync - Folder Comparison and Synchronization","","ComboBox1",$source,1) ControlSetText("FreeFileSync - Folder Comparison and Synchronization","","ComboBox2",$dest,1) ControlClick("FreeFileSync - Folder Comparison and Synchronization","","Button1") ExitLoop Else MsgBox(0,"Error","The selected source equals your destination.",6) EndIf Case $msg = $proceed If GUICtrlRead($way_l) = "->" Then $dest = GUICtrlRead($right_selection_l) $source = GUICtrlRead($left_selection_l) ElseIf GUICtrlRead($way_l) = "<-" Then $source = GUICtrlRead($right_selection_l) $dest = GUICtrlRead($left_selection_l) EndIf If $source <> $dest Then Run(@comspec & ' /c ' & @TempDir & '\MyTool\Mirror.exe "' & $source & '" "' & $dest & '" -lm=n -x="' & $source & '\$RECYCLE.BIN\*.*" -x="' & $dest & '\$RECYCLE.BIN\*.*" -x="' & $source & '\RECYCLER\*.*" -x="' & $dest & '\RECYCLER\*.*" & pause') ExitLoop Else MsgBox(0,"Error","The selected source equals your destination.",6) EndIf Case $msg = $left $selection = GUICtrlRead($left) Select Case $selection = "MRF" GUICtrlSetData($left_selection_l, $mrf) Case $selection = "MRP" GUICtrlSetData($left_selection_l, $mrp) Case $selection = "MRM" GUICtrlSetData($left_selection_l, $mrm) Case $selection = "MRS" GUICtrlSetData($left_selection_l, $mrs) EndSelect Case $msg = $right $selection = GUICtrlRead($right) Select Case $selection = "MRF" GUICtrlSetData($right_selection_l, $mrf) Case $selection = "MRP" GUICtrlSetData($right_selection_l, $mrp) Case $selection = "MRM" GUICtrlSetData($right_selection_l, $mrm) Case $selection = "MRS" GUICtrlSetData($right_selection_l, $mrs) EndSelect Case $msg = $exit Exit Case $msg = $way Select Case GUICtrlRead($way_l) = "->" GUICtrlSetData($way_l, "<-") Case GUICtrlRead($way_l) = "<-" GUICtrlSetData($way_l, "->") EndSelect EndSelect WEnd Else MsgBox(0,"Error","You have to connect a Base FS in order to perform this operation.",6) EndIf GUIDelete() EndFunc ;___________________________________________________________________________________________________________________ Func mbr() GUICreate("mbr",500, 300) $mbr1 = GUICtrlCreateRadio("Vista/7 MBR", 35, 165, 120, 30) $mbr2 = GUICtrlCreateRadio("XP/2003 MBR", 35, 225, 120, 30) $mbr3 = GUICtrlCreateRadio("Grub4Dos MBR", 35, 195, 120, 30) $tab2showoptionsmbr = GUICtrlCreateButton("Show Options", 225, 178, 150, 25) $applymbr = GUICtrlCreateButton("Apply", 225, 217, 150, 25) $tab2check1 = GUICtrlCreateCheckbox("Show Console", 45, 345, 120, 20) $tab2input = GUICtrlCreateInput("", 225, 280, 20, 20) GUICtrlCreateLabel("Enter drive letter", 130, 280, 90, 20) GUICtrlCreateLabel("and options here", 250, 280, 400, 20) $tab2input2 = GUICtrlCreateInput("", 40, 310, 420, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $applymbr Select Case GUICtrlRead($mbr1) = $GUI_CHECKED Run(@comspec & ' /c "' & @ScriptDir & '\bootsect.exe" /nt60' & $mbroptions) Case GUICtrlRead($mbr3) = $GUI_CHECKED (@comspec & " /c " & 'bootlace.com %g4doptions%') Case GUICtrlRead($mbr2) = $GUI_CHECKED (@comspec & " /c " & 'bootsect.exe %kerneloptions%') EndSelect EndSelect WEnd GUIDelete() EndFunc ;___________________________________________________________________________________________________________________ Func mymusic() GUICreate("mymusic",250, 135) $tab5 = GUICtrlCreateTabItem("MyMusic") GUICtrlCreateLabel("Select your source:",0,24,250,20,$SS_CENTER) $mymusicsource = GUICtrlCreateCombo("", 25, 50, 200, 120) If $mrs Then GUICtrlSetData($mymusicsource, $mrs ,$mrs) EndIf If $mrm Then GUICtrlSetData($mymusicsource, $mrm ,$mrm) EndIf If $mrf Then GUICtrlSetData($mymusicsource, $mrf ,$mrf) EndIf If $mrp Then GUICtrlSetData($mymusicsource, $mrp ,$mrp) EndIf $musicproceed = GUICtrlCreateButton('Proceed',85, 85, 80, 25) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $musicproceed $mymusicsource = GUICtrlRead($mymusicsource) $all[0] = 'Converted songs:' If FileExists($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major\*.mp3') Then $list = _FileListToArray($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major', '*.mp3') For $i = 1 To $list[0] _ID3ReadTag( $mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major\' & $list[$i], 0, -1, 0 ) _ID3SetTagField('APIC', $mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major.jpg') _ID3SetTagField('TALB','Major Classics') _ID3SetTagField('TPE1','Classic') _ID3WriteTag($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major\' & $list[$i]) Next _ArrayAdd($all, '- Classic - Major -') $list[0] = $list[0] & ' songs' _ArrayConcatenate($all,$list) EndIf If FileExists($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor\*.mp3') Then $list = _FileListToArray($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor', '*.mp3') For $i = 1 To $list[0] _ID3ReadTag( $mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor\' & $list[$i], 0, -1, 0 ) _ID3SetTagField('APIC',$mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor.jpg') _ID3SetTagField('TALB','Minor Classics') _ID3SetTagField('TPE1','Classic') _ID3WriteTag($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor\' & $list[$i]) Next _ArrayAdd($all, '- Classic - Minor -') $list[0] = $list[0] & ' songs' _ArrayConcatenate($all,$list) EndIf If FileExists($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm\*.mp3') Then $list = _FileListToArray($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm', '*.mp3') For $i = 1 To $list[0] _ID3ReadTag( $mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm\' & $list[$i], 0, -1, 0 ) _ID3SetTagField('APIC',$mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm.jpg') _ID3SetTagField('TALB','Calm') _ID3SetTagField('TPE1','Mixed') _ID3WriteTag($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm\' & $list[$i]) Next _ArrayAdd($all, '- Mixed - Calm -') $list[0] = $list[0] & ' songs' _ArrayConcatenate($all,$list) EndIf If FileExists($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky\*.mp3') Then $list = _FileListToArray($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky', '*.mp3') For $i = 1 To $list[0] _ID3ReadTag( $mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky\' & $list[$i], 0, -1, 0 ) _ID3SetTagField('APIC',$mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky.jpg') _ID3SetTagField('TALB','Funky') _ID3SetTagField('TPE1','Mixed') _ID3WriteTag($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky\' & $list[$i]) Next _ArrayAdd($all, '- Mixed - Funky -') $list[0] = $list[0] & ' songs' _ArrayConcatenate($all,$list) EndIf FileMove($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Funky\*.mp3', $mymusicsource & '\_MyFiles\MyMusic\Library\Mixed - Funky') FileMove($mymusicsource & '\_MyFiles\MyMusic\Updates\Mixed - Calm\*.mp3', $mymusicsource & '\_MyFiles\MyMusic\Library\Mixed - Calm') FileMove($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Minor\*.mp3', $mymusicsource & '\_MyFiles\MyMusic\Library\Classic - Minor') FileMove($mymusicsource & '\_MyFiles\MyMusic\Updates\Classic - Major\*.mp3', $mymusicsource & '\_MyFiles\MyMusic\Library\Classic - Major') _ArrayDisplay($all,'Converted songs:') ExitLoop EndSelect WEnd GUIDelete() EndFunc ;___________________________________________________________________________________________________________________ Func tfzwei() $steamexe = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamExe") If FileExists($steamexe) Then ProcessClose("steam.exe") Run(@comspec & " /c " & '"' & $steamexe & '" -login cyankher binlad3n -applaunch 440 -dev -console +cl_showfps 2', "", @SW_HIDE) Exit Else MsgBox(4, "Found no Registry entry of Steam", "Be sure to have a valid installation with current registry entries.", 8) EndIf EndFunc ;___________________________________________________________________________________________________________________ Func portaltwo() $steamexe = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamExe") If FileExists($steamexe) Then ProcessClose("steam.exe") Run(@comspec & " /c " & '"' & $steamexe & '" -login flok3rsportal binlad3n -applaunch 620 -dev -console +cl_showfps 2', "", @SW_HIDE) Exit Else MsgBox(4, "Found no Registry entry of Steam", "Be sure to have a valid installation with current registry entries.", 8) EndIf EndFunc ;___________________________________________________________________________________________________________________ Func guiset($mode) Select Case $mode = 'hide' $pos = WinGetPos('MyTool by Flok3r') RegWrite('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'x-pos', "REG_SZ", $pos[0]) RegWrite('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'y-pos', "REG_SZ", $pos[1]) GUISetState(@SW_HIDE) Case $mode = 'show' GUISetState(@SW_SHOW) EndSelect EndFunc ;___________________________________________________________________________________________________________________ Func getdrive() $var = DriveGetDrive("ALL") For $i = 1 To $var[0] If DriveGetLabel($var[$i]) = "MyPortable" Then $mrp = $var[$i] EndIf If DriveGetLabel($var[$i]) = "MyRescue" Then $mrf = $var[$i] EndIf If DriveGetLabel($var[$i]) = "MyMini" Then $mrm = $var[$i] EndIf If DriveGetLabel($var[$i]) = "MyStorage" Then $mrs = $var[$i] EndIf Next If $mrf Then $base = $mrf ElseIf $mrp Then $base = $mrp ElseIf $mrm Then $base = $mrm ElseIf $mrs Then $base = $mrs EndIf EndFunc ;___________________________________________________________________________________________________________________ Func autostart() Switch GUICtrlRead($autostart) Case "Enable autostart" If @Compiled = 1 Then GUICtrlSetData($l_autostart, "Disable autostart") RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run','MyTool', 'REG_SZ','"' & @ScriptFullPath & '"') Else MsgBox(0,"Error","Your script is not compiled.",5) EndIf Case "Disable autostart" If @Compiled = 1 Then GUICtrlSetData($l_autostart, "Enable autostart") RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run','MyTool') Else MsgBox(0,"Error","Your script is not compiled.",5) EndIf EndSwitch EndFunc ;___________________________________________________________________________________________________________________ Func custom_button($text, $left, $top, $text_size = 8.8, $font_top = 5, $font_color = 0xFFFFFF, $width = 150, $height = 25, $pic = $buttonpng) ;topfont = pixel between picture frame an label Local $button $button = GUICtrlCreatePic( "",$left,$top,$width,$height) _SetImage(-1, $pic) GUICtrlCreateLabel($text,$left,($top + $font_top),$width,$height, $SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;Makes the label transparent, so that it wont cover the pic GUICtrlSetColor(-1, $font_color) GUICtrlSetFont(-1,$text_size) Return $button EndFunc ;___________________________________________________________________________________________________________________ Func exitfunc() $pos = WinGetPos('MyTool by Flok3r') RegWrite('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'x-pos', "REG_SZ", $pos[0]) RegWrite('HKEY_CURRENT_USER\Software\Flok3r\MyTool', 'y-pos', "REG_SZ", $pos[1]) DllClose($dll) Exit EndFunc 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