Prevent a window from being activable

I have developed a virtual keyboard, but each time I click on it, it snatches activation. Obviously, that is not how it should work. I tried SetWindowPos with SWP_NOACTIVATE, but that works only when setWindowPos, and at the next click, the window activates as usual.

I posted the question on SO, and someone advised :


I looked up WM_MOUSEACTIVATE in Msdn at and it looks like that is indeed what is needed.

Now my problem is to implement it.

Paul Lefebvre showed me how to trap messages in

I added the WndProcSubclassWFS and looked at msg in the WndProc method that is created by the interface. It gets lots of values, but I do not see any &h21.

What am I missing ?


OK. As usual, posting a question reveals the answer.

I do see dec. 33, and passingConst SWP_NOACTIVATE (3) as returnValue, together with Return True, the window no longer activates :slight_smile: