Re: Don't want to wait for a returned value from SendMessage???

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: BadOmen (badomen02_at_hotmail.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 21:59:03 GMT

Thanx!!
:-D

"Stoil Marinov" <stoil_marinov.OBVIOUS@hotmail.com> skrev i meddelandet
news:c1geh6$1gk7bq$1@ID-24932.news.uni-berlin.de...

"BadOmen" <badomen02@hotmail.com> wrote in message
news:XVO_b.50150$mU6.201210@newsb.telia.net...
> I am using SendMessageA to send a command to WinAmp and it works, The Open
> File(s)
> is opening but my program halts until I press the Open or Cancel button. I
> think my program is waiting for a returned value that is sent from WinAmp
> when the Cancel or Open button is pressed.
>
> I have a problem with this because I am using a remote to execute this
> command so after I have done that I want to be able to use my remote to
move
> and press the mouse button so I can select a file... But because my
program
> halts until I have pressed the Open or Close button I cant use the remote
to
> move the mouse and open a file... I have to GO to the computer and do it
> manually...
>
> Plz help me with this, otherwise I might get exercise running to my
> computer.. :P
>
>
> Call SendMessageA(WinAMPhWnd, WM_COMMAND, WINAMP_FILE_PLAY, 0)

Use PostMessage() instead:

Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As
Long) As Long

SendMessage() waits for the other app to process the message before
returning back.
PostMessage() returns immediately after posting the message.

Regards,

Stoil
>
> Yours, Jonas
>
>



Relevant Pages

  • Re: Dont want to wait for a returned value from SendMessage???
    ... > I am using SendMessageA to send a command to WinAmp and it works, ... > is opening but my program halts until I press the Open or Cancel button. ...
    (microsoft.public.vb.winapi)
  • Dont want to wait for a returned value from SendMessage???
    ... I am using SendMessageA to send a command to WinAmp and it works, ... is opening but my program halts until I press the Open or Cancel button. ... I have a problem with this because I am using a remote to execute this ...
    (microsoft.public.vb.winapi)
  • Re: to make windows open programs with one click
    ... For instance I would like winamp and skype to start with one click instead ... The full syntax for the Start command goes like this. ... to include the double quotes! ...
    (microsoft.public.windowsxp.general)
  • Re: Using ghostscript pdfopt
    ... Author> The program halts with the message; "Bad command or ... This error message suggests that the named program cannot be found. ...
    (comp.lang.postscript)
  • launchin external application
    ... I would like to have some help on howto launch an external application in ... visual studio .net 2003 / C++ language. ... //executes tis command in the shell ... But let's say I want to start winamp or so? ...
    (alt.comp.lang.learn.c-cpp)