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!

Need to Sendmessage to an App

Status
Not open for further replies.

Oppenhiemer

Programmer
Jun 28, 2001
315
GB
Hi all -

Basically,I would like to send a message to Windows Media player to make it go to full screen mode from my app.

The actual key combination to achive this in the App itself is ALT+ENTER. There seems to be more than one approach to achieving this - and I guess Im after the simplest ;-).

I guess I could use SendKeys or Sub-class the apps Winodws procedure and send a message directly (one i know the correct params etc.) The second way (as I remember from grim experience) can be quite complex - so another method would be preferable (SendKeys ?)

Anyway, does anyone know how I can achive this task ?

Many thanks..

Opp.
 
I think you could use:

Handle := findwindow(pchar('WMPlayerApp'),pchar('Windows Media Player'));

ShowWindow(Handle,SW_Maximize);

I haven't tried this myself.
Brian
 
Use SendMessage to send the appropriate WM_KEYDOWN messages. Presumably that would work.
 
Thanks guys - solved it. Dont know why, but I did not get an email notification that anyone answered this thread. Anyway as I say, managed to solve it using both what Brian and mikeEd suggest.

What the customer wanted was to automatically launch Windows Media player when windows started - then go immediately to Full SCreen mode (it was for some sort of running demo.) When I realised that you could not do this with command line arguments, thought I would have to do some programming ;-).

So good result in the end and thanks for feedback.

Opp.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top