Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If Explorer.exe is restarted the script stop working until you restart it too #78

Open
imagicalFantasy opened this issue Dec 17, 2024 · 2 comments

Comments

@imagicalFantasy
Copy link

Sometime explorer.exe crash for any random reason (not-VD.ahk related) just the legendary windows stability or it just need to be restarted for any reason. After that, VD.ahk related keybind won't have effect anymore. It can be fixed be restarting the auto hotkey app or script. It could be nice if VD.ahk could fix the issue itself without restarting the script.

@FuPeiJiang
Copy link
Owner

@imagicalFantasy a quick workaround would be to add VD._init() in front of every hotkey

numpad2::VD.goToDesktopNum(2)

would become

numpad2::VD._init(), VD.goToDesktopNum(2)

___
this workaround wasn't found by me, this technique was from a past issue

I thought to hook/get notified when explorer.exe is restarted, but that would add too much code, but I would have to recheck

@FuPeiJiang
Copy link
Owner

@imagicalFantasy nvm, it turns out, it's very short, and can be achieved with only this line of code

OnMessage(DllCall("RegisterWindowMessageW","WStr","TaskbarCreated","Uint"), (*)=>VD._init())

thanks for suggesting this

FuPeiJiang added a commit that referenced this issue Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants