By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,414 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,414 IT Pros & Developers. It's quick & easy.

Getting External Focus

P: n/a
I'm trying to get (or set) the focus on an external window but to no avail. I've imported the "GetActiveWindow" and "GetFocus" from the user32.dll but those 2 functions seem to only work for windows my application owns... I can get the hWnd of the process I want to check/set focus on. Any help would be greatly appresated.

Just to be a little more clear, say NotePad is up; I'm trying to make my program set focus to the opened Notepad Process (though its hWnd if possible?), or check when the opened NotePad process gets focus. Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
To get the focus of another application use

int hwnd = FindWindow(null,"App titile");

//use this handle to set the focus or bring window to top.

Shak.
<Qu****@hotmail.com> wrote in message news:2GRAc.18170$by2.3302@edtnps84...
I'm trying to get (or set) the focus on an external window but to no avail. I've imported the "GetActiveWindow" and "GetFocus" from the
user32.dll but those 2 functions seem to only work for windows my
application owns... I can get the hWnd of the process I want to check/set
focus on. Any help would be greatly appresated.
Just to be a little more clear, say NotePad is up; I'm trying to make my program set focus to the opened Notepad Process (though its hWnd if
possible?), or check when the opened NotePad process gets focus. Thanks

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.