There were some windows opened, And from my process I want to launch one more window(high priority) in which user has to enter credentials. And i want to put this credentials window to foreground, in turn it might give good experience to user as he need not manually select the credentials window. And this is one time launching, definitely not annoying but compulsory for user to enter creds.
what is the best way to achieve this? I don’t think simulating mouse click is good idea. Is there a way to send msg to rest of windows to lose their focus? so that when i launch my window, it will come foreground.
This works for me without having to use
SetWindowPosto make the window ‘always on top’:I use this in a chat application so a new chat message can steal focus (optional obviously as some users don’t like this.)