For example : I have my custom exe lets say "sample.exe". Assume firefox was my default browser on windows 10, and now i changed it to google chrome. So after changing default browser to google chrome, is there any way to register sample.exe to receive callback.
Is there any way to receive callback to our custom exe when user changed default browser on windows?
Asked
Active
Viewed 70 times
-2
-
2I would hope not. – ThingyWotsit Jun 02 '17 at 11:10
-
Well, this is not a C programming question!! – Gaurav Pathak Jun 02 '17 at 11:37
-
You need to play with Windows registry in order to check which is the default browser, but regarding callback notification I am clueless... Maybe [this](https://stackoverflow.com/questions/13621467/how-to-find-default-web-browser-using-c) gives you a bit of hint. – Gaurav Pathak Jun 02 '17 at 11:42
1 Answers
0
You need to register with the windows registry, identify the key that denotes the default browser and then set up a RegNotifyChangeKeyValue
callback. There is a number of possible variations on how a default browser can be set which is - due to the fact that you didn't exactly ask for that - probably too much to ask for inclusion in this answer. Here is a nice article on this topic.
This will call your code when something happens with the specified registry key.
Note this callback is not called on bulk changes to the registry - So depending on the method the default browser is changed, it might or might not be called.

tofro
- 5,640
- 14
- 31