Since Win2k/WinXP I do used my shown way, tricky part was registry.
I programmed it for a media player, moving mouse would start show timeline so that was a no-go in my case.
For registry I can recommend, on startup of your app, collect the info from registry, it is a string, replace that string with really a "0" as string, when ending app, restore your original saved value.