Rusty_Alley Posted November 19, 2018 Posted November 19, 2018 I'm making a Caps Lock Indicator which displays an image depending on if caps lock is on or off and I keep leaving it one because I'm stupid haha but I want to add a timed alert the reminds me if I leave it on can people help? I'm a bit lost #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=output.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #NoTrayIcon #include <TrayConstants.au3> #include <Misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <TrayConstants.au3> Func _GetCapsLock() Local $ret $ret = DllCall("user32.dll","long","GetKeyState","long",$VK_CAPITAL) Return $ret[0] EndFunc Global Const $VK_CAPITAL = 0x14 $bcapchk = false ConsoleWrite($VK_CAPITAL) while 1 If _GetCapsLock() Then if $bcapchk = False Then ConsoleWrite("On") ConsoleWrite(@WorkingDir & "\on.ico") TraySetIcon("on.ico") $bcapchk = True EndIf Else if $bcapchk = True Then ConsoleWrite("Off") ConsoleWrite(@WorkingDir & "\off.ico") TraySetIcon("off.ico") $bcapchk = False EndIf if $bcapchk = True Then $begin = TimerInit() EndIf WEnd TrayTip("I'm a title", "I'm the message", 0, $TIP_ICONASTERISK) MsgBox($MB_SYSTEMMODAL, "", "Press OK to reset the tip.") TrayTip("clears any tray tip", "", 0) MsgBox($MB_SYSTEMMODAL, "", "Press OK to see another tip.") TrayTip("", "A different tray tip.", 5) Sleep(5000)
Nine Posted November 19, 2018 Posted November 19, 2018 instead of TimerInit() take a look at _Timer_SetTimer it will lauch a function after some delay “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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