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 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_NCACTIVATEmessage for the period of the possible flash. Either prevent the message to reachDefWindowProc, or modifywParamto be ‘true’ as in this answer.