开发者

Prevent my window from flashing when inactiv under short period

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜