Advertisement
Lorenzo501

Critical(-1) might be fine in auto-execute (AutoHotkey / Time Saver)

Mar 7th, 2025
31
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Critical(-1) in auto-execute might make WinEvent handlers Critical(-1) by default as well, so then those WinEvent handlers won't need to set it then
  2.  
  3. Making whichever WinEvent handler gets executed first get executed completely, before any other thread (WinEvent handler or not), goes next
  4.  
  5. It might not matter that non-WinEvent-handler threads execute with that setting, they could just be changed if really necessary, using Critical("Off") if they need to be made interruptible or if atleast message checks need to be performed, then could just be changed using Critical()
Advertisement
Comments
  • Lorenzo501
    24 days
    # text 0.42 KB | 0 0
    1. The only downside that I can imagine right now would be that you'd have to remember what it being used in the (auto-execute) Initialize() fn. For example as in; you could forget that it is set to that and then while you're executing a busy non-WinEvent-handler thread where it also affects Sleep(), then you're wondering why it doesn't get interrupted by anything that you wanted to trigger.. But you'd probably figure it out quick <.<
  • Lorenzo501
    24 days (edited)
    Comment was deleted
  • Lorenzo501
    24 days
    # text 0.23 KB | 0 0
    1. I'd have to be careful and basically read all my code, because for example there's a WinEvent handler in the uTorrent RButton hotkey that has a temporary hotkey, which needs to be able to interrupt the loop within that WinEvent handler..
Add Comment
Please, Sign In to add comment
Advertisement