开发者

Prevent my window from flashing when inactiv under short period

开发者 https://www.devze.com 2023-02-10 10:45 出处:网络
I\'m creating av On screen keyboard. To send keys I do following (pseudocode): SetMyWindowTopMost(true)

I'm creating av On screen keyboard. To send keys I do following (pseudocode):

SetMyWindowTopMost(true)
SetReceiverWindowActive()
Sleep(100)
SendInput(keys)
SetMyWindowActive()
SetMyWindowTopMost(false)

I give focus to another application for a short time (~100 ms) and then regains focus. But开发者_如何学Python I do not want it to appear

The problem is that my program flashes every time it becomes inactive and then active again. Can I prevent it in any way, so that it looks like it is constantly active.


You would be handling WM_NCACTIVATE message for the period of the possible flash. Either prevent the message to reach DefWindowProc, or modify wParam to be 'true' as in this answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消