Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 May : Prevent application activation
| Subject: | Prevent application activation |
| Posted by: | "Jazmin" (spam@spam.com) |
| Date: | Fri, 4 May 2007 10:29:58 |
Suppose my application is hidden (and running on the background) with
the following statements:
Application.MainForm.Visible := False;
ShowWindow(Application.Handle, SW_HIDE) <- taskbar button
In a given moment a timer creates another Form (a popup)
How to prevent that the application (or this new form) becomes activate
(top-most)? Focus is moved to the new window!
By now, this is all I could do: When the timer executes...
(1) currentWindow := getForegroundWindow;
(2) TPopupForm.Create(self);
(3) SetForegroundWindow(currentWindow);
(1) saves current window, and (3) sets it again.
The problem is that this process is not invisible to the user, and he
can see how focus goes away from current window, and then goes in again.
Do you have other ideas?
Thanks a lot.
JZ