Closed ZhuangQu closed 1 year ago
Why are you calling it every 100ms for an hour? There is event listener which triggers when you change desktop.
I've even gotten explorer.exe to crash if I call some of the functions too many times, something goes wrong somewhere.
I call the DLL so frequently to know whether the desktop has changed. The listener will crash when I add a desktop in taskview, so I dare not use it.
I add
ProcessSetPriority("Realtime")
to my AutoHotkey script and it doesn't crash anymore. I don't know why so.
Do you add and remove a lot of desktops every day?
Listener is a way to go here, but I do need to find the crash and fix it.
I have 16 desktops at all times, I don't add and remove these practically ever so it's a rare occasion for me.
Yes! And I found that raising the process priority can solve the problem, so I close it.
My system is Windows 11. I wrote an AutoHotkey script which executes
GetDesktopCount
,GetCurrentDesktopNumber
andGetDesktopName
for 16 consecutive times every 100 ms. After running for about 1 hour, AutoHotkey crashes with0xC0000005
and then loses response.