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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to bring another application to the top?

Status
Not open for further replies.

ricardospam

Programmer
Sep 21, 2006
4
BR
Hi all!

I'm in Windows 2000 and Windows XP

I wanna send a "maximize message" to another application

I tried some like that
PostMessage( FindWindow(nil, 'Caption of that program') , SW_MAXIMIZE,0,0);

but whithout efects

how can I do this?

thanks a lot!
 
try it this way

Code:
SendMessage(FindWindow(nil, 'Caption of that program') ,WM_SYSCOMMAND, SC_MAXIMIZE, 0);

Aaron
 
It works!
Thanks a lot!


by the way,

I saw you used SendMessage and I tried with PostMessage and asked to my self:
What's the diference?
and I found this answer in the help of the delphi:

"SendMessage calls the window procedure for the specified window and does not return until the window procedure has processed the message.

The PostMessage function, in contrast, posts a message to a thread's message queue and returns immediately."
 
so to resume, sendmessage is synchronous and postmessage is async style...

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top