Webbrowser steals focus

前端 未结 7 1816
天命终不由人
天命终不由人 2021-01-06 07:17

I\'m using webbrowser control in my winforms app (c#). And when it is doing automation things, I\'m losing focus control from the window I was working with. Webbrowsers\' fo

相关标签:
7条回答
  • 2021-01-06 08:01

    You could try disabling it globally via the SystemParametersInfo api. Use SPI_SETFOREGROUNDLOCKTIMEOUT. Setting foreground lockout is a global settings, so you will want to clear this setting when you're done. A more permanent solution is to change HKCU\Control Panel\Desktop\ForegroundLockTimeout registry key. See also this discussion on social.msdn (specifically, billb08's answer).

    0 讨论(0)
提交回复
热议问题