Re: Give the Focus to my application
- From: Jonathan Arnold <jdarnold_online@xxxxxxxxxxxxxxx>
- Date: Thu, 21 Apr 2005 15:33:10 -0400
Frederic wrote:
Hello,
I've got a question that looks simple but that gave me a headache...
I've got an application and this application must always have the focus. I created a timer that expires each second, and each time it expires, it must give the focus to my application (in case user switched to another application).
I tried many functions below to give the focus to my app, but none worker: * ShowWindow(SW_SHOW); * SetActiveWindow(); * SetFocus(); * SetForegroundWindow(); * SetRedraw(); * SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); I also simulated a click within my dialog but it did not worked.
How can I give the focus to my app???
In general, WinXP & Win2K are very very tough on applications that demand to get the focus. They generally don't allow any random app to grab the keyboard focus; rather, the button in the tak bar blinks indicating to the user an app is begging for attention. This is a much better user interface design, but it sure can be frustrating from the developer point of view.
-- Jonathan Arnold inSORS .
- References:
- Give the Focus to my application
- From: Frederic
- Give the Focus to my application
- Prev by Date: Re: MSVC++ app type choice, form design questions
- Next by Date: Linker Error that I can't resovle
- Previous by thread: Re: Give the Focus to my application
- Next by thread: Re: Print Preview broken again!
- Index(es):