Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, does anyone know how to over

Status
Not open for further replies.

cra

Programmer
Sep 23, 2002
34
DE
Hi,

does anyone know how to overcome the following restriction in the Win32 API under Win2K/XP?

"Windows NT 5.0 and later: An application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see SetActiveWindow) and call theFlashWindowEx function to notify the user."

Perhapse there is some "switch" in the registry to allow it again ??? :)
 
I don't think that's possible, since this functionality has been build into the OS to protect the user from unwanted dialogs from any application when working in another application.

Greetings,
Rick
 
Ha! Found it in the MS Knowledge base: Call

SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (LPVOID)0, SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE)

and *all* the applications on your system behave like under Windows NT or 95 and can put themselves into the foreground - this is a global setting that is changed in the user profile of the current user.

:) :) :) :)

 
But you'll have to do it separately then. This call cannot be made from within the application you need to have put on the foreground.

Greetings,
Rick
 
yes of course... and it would be bad style to do it before when the application *is* in the foreground (at least without asking the user to allow a user profile modification).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top