Leaderboard
Popular Content
Showing content with the highest reputation on 06/24/2016 in all areas
-
GUI/Tray Menu with icons and colors
abberration reacted to Holger for a topic
Hi outthere here is my script-stuff to create ownerdrawn menuitems with icons and colors. It uses GUIRegisterMsg() and WM_DRAWITEM / WM_MEASUREITEM - messages proceeding. Holger Update 06.05.2008: !!! Warning: Script breaking !!! Please change the following commands to: _TrayCreateItem(Text, ...) _TrayCreateMenu(Text , ...) - Fixed: some old values (thanks to aGorilla) - Fixed: ..SetText() functions (thanks to MrCreatoR) - Added the following commands: _SetMenuIconBkGrdColor(Color) ; set icon background gradient color _SetTrayIconBkGrdColor(Color) ; set icon background gradient color New sidebar menu commands: _CreateSideMenu(MenuID) ; returns a SideMenuID/index _DeleteSideMenu(SideMenuID) ; delete a menu sidebar _SetSideMenuText(SideMenuID, Text) ; set a text for the sidebar _SetSideMenuColor(SideMenuID, Color) ; set text color _SetSideMenuBkColor(SideMenuID, Color) ; set text background color _SetSideMenuBkGradColor(SideMenuID, Color) ; set text background gradient color _SetSideMenuImage(SideMenuID, Bitmapfile [, Resourcename/number [, Expand/Compress Bitmap]]) Just take a look into the samples how to use them! At the moment there are some known issues: - missing 64bit compatibility (already in progress, to fully work with "AutoIt3_x64.exe") - moving the mouse cursor on the sidebar menu image/text also changes the current menu item selection - for sidebar menu image only bitmaps are supported at the moment (min.8bpp) Update 23.03.2008: !!! Warning: Please update all your scripts and add after _TrayIconCreate() the command _TrayIconSetState() - otherwise you will not see any tray icons!!! Also update your icon numbers like for GUI icons - Fixed: some things (thanks to nickston) - Changed: _TrayIconCreate() do not show automatically the icon - Changed: icon behaviour now more similar to GUI icons (I hope) - Added: command.txt - Removed: unicode macro History: CODEUpdate 21.03.2008: - Changed: dynamic array sizing of the saved menu items - Added: _TrayDeleteItem(menuID), _GUICtrlODMenuItemDelete($nID) - please delete menu (items) with these commands - Added: _TrayIconSetState() modes 4 and 8 for flashing and flashstopping of tray icons - Added: _SetFlashTimeOut([timeOut]) to set the flash timeout - Added: OnEvent sample Update 23.02.2008: - Fixed: GDI object overload while using bold font Update 22.02.2008: - Added: _TrayItemSetSelIcon(ItemID, IconFile, IconID) - set the icon if the item is selected - Added: _GUICtrlODMenuItemSetIcon(ItemID, IconFile, IconID) - set the icon of the item - Added: _GUICtrlODMenuItemSetSelIcon(ItemID, IconFile, IconID) - set the icon if the item is selected - Added: "ModernMenuRaw.au3" which only includes the unknown constants, should better work with 'Au3Check' now Update 12.01.2008-2: - Fixed: Missing underscore in "CreateMenuFontByName"-function (Font fallback function) (thanks to MsCreatoR and GEOSoft). - Changed: If a menuitem is disabled then the rect only is showing around the item - Added: Underscore in menutext only showing when pressing "Alt"-key Update 12.01.2008: - Changed: 'local' Dll calls to global DllOpen to speedup (some virusscanners sometimes slowdown the process cause of opening these Dll's again and again) - Added: Using of @Tab for accelerator showing/drawing Update 07.12.2007: - Changed: all stuff in only 1 ZIP file - Fixed: now works with 3.2.10.0 and 3.2.8.1 Update 03.08.2007 - Fixed: error in _TrayIconDelete() and new creation - Added: additional parameter to _TrayIconCreate(ToolTip, IconFile, IconID, Callback, Msg, hIcon) to use existing icon handles - Added: sample_Win2Tray: 'moves' all minimized windows to the tray Update 28.07.2007 - Fixed: wrong call of function CreateFont() - Thanks to SleepyExtreme for info - Changed: included samples to demonstrate using of icon clicks Update 26.07.2007 - Fixed: missing function: LoadIcon() Update 21.07.2007 - added bold item support - limited to menuitems only, menus are not supported Update 17.07.2007: - now you can also menu icons for the tray - added commands for Tray: _TrayIconCreate() _TrayCreateMenu() _TrayCreateItem() _TrayItemSetIcon() _TrayIconSetState() _TrayTip() So you can have more than 1 tray icon for 1 Autoit3-script. Update 01.07.2007: - now works with unicode (3.2.4.9) - new command: _GUICtrlODMenuItemSetText(ControlID, NewText) Update 21.08.2006: - delete 1 line in libs to work with current release 3.2.0.X (error: cannot redeclare constant...) - Thanks to Javascript_Freek for info Update 02.02.2006: - added Checked-state for normal menu items and radio menu items - added a like ModernMenuLib-script for easier create/use these menustuff (see sample in the ModernMenuLib-folder) ModernMenuLib_with_Tray.zip1 point -
Bluetooth Detector/Switching Script
Qwerty212 reacted to stormbreaker for a topic
Hello everybody, this is my first example script weeks after giving my exams. Here is it: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Bluetooth Manager (just something)", 409, 135, 192, 124) $Label1 = GUICtrlCreateLabel("This script will check if your PC is bluetooth enabled.", 8, 8, 368, 17) $Button1 = GUICtrlCreateButton("Check if device present", 112, 48, 171, 25, $WS_GROUP) $Checkbox1 = GUICtrlCreateCheckbox("Disable Discovery for all Bluetooth Devices on PC", 16, 96, 257, 17) $Button2 = GUICtrlCreateButton("Exit", 312, 96, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $RESULT = DllCall("bthprops.cpl", "Bool", "BluetoothEnableIncomingConnections", "Handle", 0, "Bool", 1) If $RESULT[0] = 1 then msgbox(64, "Message", "Congrats! Your Computer is bluetooth enabled.") else msgbox(16, "", "No device found") EndIf Case $Checkbox1 If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then $RESULT = DllCall("bthprops.cpl", "Bool", "BluetoothEnableDiscovery", "Handle", 0, "Bool", 0) msgbox(64, "", "Discovery Disabled.") Else $RESULT = DllCall("bthprops.cpl", "Bool", "BluetoothEnableDiscovery", "Handle", 0, "Bool", 1) msgbox(64, "", "Discovery Enabled.") EndIf Case $Button2 Exit EndSwitch WEnd It can check if your PC is bluetooth enabled and can switch between bluetooth discovery modes. All functions taken from Microsoft's bthprops.cpl Constructive suggestions are always welcome Enjoy. Note: Bluetooth discoverability can be controlled as long as the script is running. Once terminated, bluetooth state changes back to previously set by user. This is a Microsoft bluetooth function issue. EDIT: This script is only meant for discovering Bluetooth Radios on a PC. That's all.1 point -
@Dent Very annoying event, but its not unpredictable. Just do the source first and you will be fine, i also add a event fire that you were forgetting. Local $oSource1 = _IEGetObjByName($oIE, "OGICMB1A") If Not IsObj($oSource1) Then Exit ConsoleWrite("Error in $oSource1" & @CRLF) _IEFormElementOptionSelect($oSource1, 8) Local $oSource1Ammount = _IEGetObjByName($oIE, "AP1AMT1") If Not IsObj($oSource1Ammount) Then Exit ConsoleWrite("Error in $oSource1Ammount" & @CRLF) _IEFormElementSetValue($oSource1Ammount, "800") $oSource1Ammount.fireEvent("OnBlur") Local $oSource2 = _IEGetObjByName($oIE, "OGICMB1B") If Not IsObj($oSource2) Then Exit ConsoleWrite("Error in $oSource2" & @CRLF) _IEFormElementOptionSelect($oSource2, 10) Local $oSource2Ammount = _IEGetObjByName($oIE, "AP1AMT2") If Not IsObj($oSource2Ammount) Then Exit ConsoleWrite("Error in $oSource2Ammount" & @CRLF) _IEFormElementSetValue($oSource2Ammount, "900") $oSource2Ammount.fireEvent("OnBlur") Local $oDateOfBirth_DAY = _IEGetObjByName($oIE, "AP1DAY") If Not IsObj($oDateOfBirth_DAY) Then Exit ConsoleWrite("Error in $oDateOfBirth_DAY" & @CRLF) _IEFormElementOptionSelect($oDateOfBirth_DAY, 1) Local $oDateOfBirth_MONTH = _IEGetObjByName($oIE, "AP1MONTH") If Not IsObj($oDateOfBirth_MONTH) Then Exit ConsoleWrite("Error in $oDateOfBirth_MONTH" & @CRLF) _IEFormElementOptionSelect($oDateOfBirth_MONTH, 1) Local $oDateOfBirth_YEAR = _IEGetObjByName($oIE, "AP1YEAR") If Not IsObj($oDateOfBirth_YEAR) Then Exit ConsoleWrite("Error in $oDateOfBirth_YEAR" & @CRLF) _IEFormElementOptionSelect($oDateOfBirth_YEAR, 1990) Local $oEmploymentStatus = _IEGetObjByName($oIE, "EmpSt1") If Not IsObj($oEmploymentStatus) Then Exit ConsoleWrite("Error in $oEmploymentStatus" & @CRLF) _IEFormElementOptionSelect($oEmploymentStatus, "O") Local $oMainIncome = _IEGetObjByName($oIE, "AFFINC1") If Not IsObj($oMainIncome) Then Exit ConsoleWrite("Error in $oMainIncome" & @CRLF) _IEFormElementSetValue($oMainIncome, "5000") $oMainIncome.fireEvent("OnBlur") Local $oBonus = _IEGetObjByName($oIE, "PW10kkbA") If Not IsObj($oBonus) Then Exit ConsoleWrite("Error in $oBonus" & @CRLF) _IEFormElementSetValue($oBonus, "1200") $oBonus.fireEvent("OnBlur") Local $oGender = _IEGetObjByName($oIE, "APP1GDR") If Not IsObj($oGender) Then Exit ConsoleWrite("Error in $oGender" & @CRLF) _IEFormElementOptionSelect($oGender, "M") Local $oJointApplication = _IEGetObjById($oIE, "JointAppN") If Not IsObj($oJointApplication) Then Exit ConsoleWrite("Error in $oJointApplication" & @CRLF) _IEAction($oJointApplication, "click")1 point
-
wait for a color with a timer and start over if it take too long
AutoBert reacted to JLogan3o13 for a topic
@AutoBert I share your frustration when people ask for help and then do not want to give enough information to facilitate that help. However, rather than responding harshly, please just move along to other threads where there is less "pulling of teeth" to get information. Perhaps the crickets chirping in this thread will be enough to convince the OP he is not giving enough info.1 point -
For understanding the diference of OnEvent and MessageLoop mode read https://www.autoitscript.com/autoit3/docs/guiref/GUIRef.htm1 point
-
jeffonce, Welcome to the AutoIt forums. Firstly, there is no need to add a Sleep within the GUIGetMsg loop - the function has its own built-in delay of ~12ms to allow the CPU to breathe and adding a further pause just makes the GUI less responsive. Next, the events that occur within the GUI are queued and dealt with in order, so you will see this sort of thing: 000ms - Start of loop 015ms - If no events, GUIGetMsg returns 0 ... - This continues until an event occurs 600ms - An event occurs and the event value (I.e. a button ControlID) is returned by GUIGetMsg. Whatever code is within that Case section of the loop is now actioned Let us say it takes 200ms to run, but another control is actioned within that time 800ms - Once back in the loop, GUIGetMsg returns the next event value. Note that the Case code for this event only runs now, not at the time the event actually occurred if you want code to run immediately the event occurs, then you need to look at HotKeys, Windows message handlers, and the like which do not depend on the main idle loop of the script. I hope that helps - please ask again if you still have questions. M231 point
-
Welcome to AutoIt and the forum! Please check XProtec in the Example Scripts section.1 point
-
Try this: $s1 = "ABC" $s2 = "XYZ" $sText = "Hi..I have a substring ABC. 8 places after ABC I have another substring XYZ. I want to validate that XYZ is displayed 8 places after ABC, for which I need the position of substring ABC. How can I get that? XYZ repeats in many places, so I cannot blindly go and search for it. ABC12345678XYZ. I am looking for the substring XYZ exactly 8 places after ABC. Once I get the position of ABC, ABC87654321XYZ, using StringMid function I can validate XYZ." ConsoleWrite("v1" & @CRLF) Check1($sText, $s1, $s2) ConsoleWrite("---------------------" & @CRLF) ConsoleWrite("v2" & @CRLF) Check2($sText, $s1, $s2) Func Check1($sText, $s1, $s2, $iDist = 8, $iCase = 0) Local $aPos[10000], $i = 1, $j = 0, $iPos Do $iPos = StringInStr($sText, $s1, $iCase, 1, $i) If Not $iPos Then ExitLoop $aPos[$j] = $iPos $j += 1 $i = $iPos + 1 Until False ReDim $aPos[$j] Local $iLen1 = StringLen($s1) Local $iLen2 = StringLen($s2) For $i = 0 To UBound($aPos) - 1 Switch $iCase Case 0 If StringMid($sText, $aPos[$i] + $iLen1 + $iDist, $iLen2) = $s2 Then ConsoleWrite("Found at pos " & $aPos[$i] & ": " & StringMid($sText, $aPos[$i], $iLen1 + $iLen2 + $iDist) & @CRLF) Case 1 If StringMid($sText, $aPos[$i] + $iLen1 + $iDist, $iLen2) == $s2 Then ConsoleWrite("Found at pos " & $aPos[$i] & ": " & StringMid($sText, $aPos[$i], $iLen1 + $iLen2 + $iDist) & @CRLF) EndSwitch Next EndFunc Func Check2($sText, $s1, $s2, $iDist = 8, $iCase = 0) Local $aFind, $i = 1, $j = 0 Switch $iCase Case 0 $aFind = StringRegExp($sText, "(?i)" & $s1 & ".{" & $iDist & "}" & $s2, 3) Case 1 $aFind = StringRegExp($sText, $s1 & ".{" & $iDist & "}" & $s2, 3) EndSwitch ReDim $aFind[UBound($aFind) + 1] Local $iLen1 = StringLen($s1) Local $iLen2 = StringLen($s2) Do $iPos = StringInStr($sText, $aFind[$j], $iCase, 1, $i) If Not $iPos Then ExitLoop ConsoleWrite("Found at pos " & $iPos & ": " & StringMid($sText, $iPos, $iLen1 + $iLen2 + $iDist) & @CRLF) $i = $iPos + 1 $j += 1 Until False EndFunc1 point
-
Don't store ANSI else you're likely to have issues someday. Simply use AutoIt native Unicode strings. Post code if you have problems.1 point
-
FileCopy -> c:\program files
dolphins reacted to JLogan3o13 for a topic
This works just fine for me: #include <File.au3> $sSource = "C:\AutoUpdate\" $sDest = "C:\Program Files\mycompany\mysubdir\" Local $aFiles = _FileListToArray($sSource, "*", $FLTA_FILES, True) For $i = 1 To $aFiles[0] $aTemp = StringSplit($aFiles[$i], "\") FileCopy($aFiles[$i], $sDest & "\" & $aTemp[$aTemp[0]]) Next1 point -
That's what Google tells me. http://www.snb-vba.eu/VBA_Dictionary_en.html#L_31 point
-
vicsar, I have replied to your PM. Your code snippet in indeed "complete rubbish" and deserves to be called as such. Sorry you took offence at that remark, but I am afraid that is the truth and I would be remiss if I did not point it out. I carefully pointed out why this was the case and how the code should have been structured - I do not see how this "prevents other from learning", nor how it would "intimidate" them as you suggested in your PM. You can see from JLogan3o13's response above that I am not alone in viewing my response in that light. If you post any snippets of that quality again you will no doubt get a similar response, from myself or another experienced user. Might I suggest that you post asking whether your approach is correct rather than immediately claiming that you have a solution - that way everyone will be able to learn, which is why we are all here in the first place. M231 point
-
Fix MySQL server crash
FrankKelly reacted to KristofLakatos for a topic
You can still read this resource for more information on your issue. https://community.office365.com/en-us/f/172/t/2664511 point -
MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.
pndhcm280- reacted to BBs19 for a topic
Try this: #NoTrayIcon #include <EditConstants.au3> #include <StaticConstants.au3> #include <MsgBoxConstants.au3> #include <Timers.au3> #include <Sound.au3> #include <MetroGUI_UDF.au3> ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) #AutoIt3Wrapper_Res_HiDpi=y $Checked = False $timer = "" $RED = 1 $sec = @SEC $Tiempo = "" $Alarm = "C:\Users\Admin\Downloads\BOMB_SIREN-BOMB_SIREN-247265934.wav" ;Replace this with your own .wav file. you already knew this what the heck ; Setting Time Variables $5m = 300000 $10m = 600000 $15m = 900250 $30m = 1800500 $45m = 2700750 $1h = 3601000 InetGet("http://imgur.com/download/C5CE14x/", @TempDir & "\Samplepic.jpg") ;=======================================================================Creating the GUI=============================================================================== ;Set Theme _SetTheme("DarkBlue") ;See MetroThemes.au3 for selectable themes or to add more ;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp. _Metro_EnableHighDPIScaling() ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe ;Create resizable Metro GUI $GLOBAL_MAIN_GUI = _Metro_CreateGUI("My app", 484, 209, 255, 124, False) $Pic1 = GUICtrlCreatePic(@TempDir & "\Samplepic.jpg", 10, 0, 460, 119, 0, $GUI_WS_EX_PARENTDRAG) ;Create an Array containing menu button names Dim $MenuButtonsArray[4] = ["Settings", "About", "Contact", "Exit"] ;Add/create control buttons to the gui $Control_Buttons = _Metro_AddControlButtons(True, False, True, False, True) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected. $GUI_CLOSE_BUTTON = $Control_Buttons[0] GUICtrlSetTip($GUI_CLOSE_BUTTON, "Close") $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] ;GUICtrlSetTip($GUI_MAXIMIZE_BUTTON , "Minimizar") $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] GUICtrlSetTip($GUI_MENU_BUTTON, "Menu") ;====================================================================================================================================================================== ;Create Buttons $Button1 = _Metro_CreateButton("start", 206, 177, 75, 25) $Button2 = _Metro_CreateButton("Abort", 380, 177, 75, 25) ;Create Toggle $Toggle1 = _Metro_CreateToggle("Alarm", 10, 147, 120, 34) GUICtrlSetTip($Toggle1, "On/Off") #Region ### START Koda GUI section ### Form= $Label1 = GUICtrlCreateLabel("My Timer", 45, 119, 366, 33, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor($Label1, 0xFFFFFF) GUICtrlSetFont(-1, 16, 0, 0, "Impact") ; Create a combobox control. $idComboBox = GUICtrlCreateCombo("Select Time", 110, 181, 90, 21) GUICtrlSetTip(-1, "Select Time") ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "5 Minutes|10 Minutes|15 Minutes|30 Minutes|45 Minutes|1 Hour", "Select Time") ; $Label2 = GUICtrlCreateLabel("How much Time?", 4, 183, 100, 25, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor(-1, 0xFFFFFF) $Inputtimer = GUICtrlCreateInput("00:00:00", 380, 147, 75, 20, BitOR($SS_CENTER, $ES_READONLY)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;~ GUIRegisterMsg(0x0201, "INTERNAL_WM_LBUTTONDOWN") While 1 _Metro_HoverCheck_Loop($GLOBAL_MAIN_GUI) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_PRIMARYDOWN DllCall("user32.dll", "int", "ReleaseCapture") DllCall("user32.dll", "long", "SendMessage", "hwnd", $GLOBAL_MAIN_GUI, "int", 0x00A1, "int", 2, "int", 0) Case $Button1 startTimer() Case $Button2 Exit Case $GUI_CLOSE_BUTTON ExitLoop Exit Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $Toggle1 If _Metro_ToggleIsChecked($Toggle1) Then _Metro_ToggleUnCheck($Toggle1) $Checked = False Else _Metro_ToggleCheck($Toggle1) $Checked = True EndIf Case $GUI_MENU_BUTTON Local $MenuSelect = _Metro_MenuStart($GLOBAL_MAIN_GUI, $GUI_MENU_BUTTON, 150, $MenuButtonsArray) ; Opens the metro Menu. See decleration of $MenuButtonsArray above. Switch $MenuSelect ;Above function returns the index number of the button from the provided buttons array. Case "0" ConsoleWrite("Returned 0 = Settings button clicked." & @CRLF) Case "1" ConsoleWrite("Returned 1 = About button clicked." & @CRLF) Case "2" ConsoleWrite("Returned 2 = Contact button clicked." & @CRLF) Case "3" ConsoleWrite("Returned 3 = Exit button clicked." & @CRLF) Exit EndSwitch EndSwitch WEnd Func startTimer() $Comboread = GUICtrlRead($idComboBox, 0) If $Comboread = 0 Then MsgBox($MB_SYSTEMMODAL, "Warning ", "You Haven't Selected Any Time", 10) Return Else If $Comboread = "5 Minutes" Then $Tiempo = $5m If $Comboread = "10 Minutes" Then $Tiempo = $10m If $Comboread = "15 Minutes" Then $Tiempo = $15m If $Comboread = "30 Minutes" Then $Tiempo = $30m If $Comboread = "45 Minutes" Then $Tiempo = $45m If $Comboread = "1 Hour" Then $Tiempo = $1h ;setting warning labels $lbl_text = GUICtrlCreateLabel("Attention!", 180, 149, 80, 17, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) ;GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlSetColor($lbl_text, 0xff0000) ; Red GUICtrlSetFont($lbl_text, 9, 700) ; $lbl_text2 = GUICtrlCreateLabel("Timer will stop in:", 250, 150, 125, 20, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) ;GUICtrlSetResizing(-1, ) GUICtrlSetColor(-1, 0xFFFFFF) ; call ("startTimer2 ") EndIf ;Checking if timer is greater than 0 If TimerDiff($timer) > 0 Then $timer = TimerInit() EndIf While (TimerDiff($timer) < $Tiempo) ;Setting Toggle _Metro_HoverCheck_Loop($GLOBAL_MAIN_GUI) ;To make sure that the hover effects still work $nMsg = GUIGetMsg() Switch $nMsg Case $Toggle1 If _Metro_ToggleIsChecked($Toggle1) Then _Metro_ToggleUnCheck($Toggle1) $Checked = False Else _Metro_ToggleCheck($Toggle1) $Checked = True EndIf Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $Button2 ExitLoop Case $GUI_CLOSE_BUTTON Exit EndSwitch $seconds = TimerDiff($timer) / 1000 $diff = $seconds - ($Tiempo / 1000) ; $minutes = Int($diff / 60) $secondsRem = $diff - ($minutes * 60) ; $hours = Int($minutes / 60) $minutes = $minutes - ($hours * 60) ; $hours = $hours * -1 $minutes = $minutes * -1 $secondsRem = $secondsRem * -1 $time = StringFormat("%02d", $hours) & ":" & StringFormat("%02d", $minutes) & ":" & StringFormat("%02d", $secondsRem) ; GUICtrlSetData($Inputtimer, $time) ;Checks if timer is higher than 3mins and If toggle is on plays Sound If TimerDiff($timer) > $Tiempo - 180000 And $Checked = True Then _SoundPlay($Alarm, 0) ;MsgBox(0,"Aviso","Alarma",5) ;Checks if timer is higher than 3mins and If toggle is off checked stops Sound If TimerDiff($timer) > $Tiempo - 180000 And $Checked = False Then _SoundStop($Alarm) ; Blinking Text If @SEC <> $sec Then $sec = @SEC If $RED Then GUICtrlSetColor($lbl_text, 0xffffff) Else GUICtrlSetColor($lbl_text, 0xff0000) EndIf $RED = Not $RED EndIf WEnd $Readtimer = GUICtrlRead($Inputtimer, 0) If $Readtimer = "00:00:00" Then MsgBox($MB_ICONWARNING, "Notice", "Time is Up!", 15) _SoundStop($Alarm) Else _SoundStop($Alarm) GUICtrlSetData($Inputtimer, "00:00:00") GUICtrlDelete($lbl_text2) GUICtrlDelete($lbl_text) EndIf EndFunc ;==>startTimer I forgot to add that option, i will add it with the next update. Just open the MetroGUI_UDF.au3 file and change the "$Font = ": Func _Internal_CreateMButton($Text, $Left, $Top, $Width, $Height, $BG_Color = $GUIThemeColor, $Font_Color = $FontThemeColor, $Font = "Arial", $Fontsize = 9, $FontStyle = 1, $FrameColor = "0xFFFFFF") You can change a lot of things in the UDF file, for some things i don't want to add an option as it makes it too complicated to set 10 parameters to create a simple button etc.1 point -
Fix MySQL server crash
FrankKelly reacted to Melba23 for a topic
Hi, Please do not bother to reply to this - it is a good example of an "astroturf" thread, the like of which we get now and again. We just wait a few days until another first-time poster appears with a possible solution (which just happens to include embedded links to their software) and then we can ban them both. M23 Edit: I see Jos had the same thoughts!1 point -
Fix MySQL server crash
FrankKelly reacted to Jos for a topic
I am sure somebody will jump in here soon to promote that miracle product solving all you troubles... lets see how long that takes. Jos1 point