|
From: <sol...@ya...> - 2003-10-02 16:37:43
|
That means your window is sending a message to itself, isn't it? That
seems to be not possible, always I try to do something like that it
doesn't react to it, and if I put a GetLastError() I get
INVALID_WINDOW_HANDLE.
Everytime I got that I had to do things another way, nothing comparable
with the situation where sending a message itself would be necessary.
If you really need do things like that and neither PostMessage work, I
would suggest making a dummy window, SW_HIDE, so you send the message to
the dummy and it resends it to the main, is the only way I can think about.
Did you try with PostMessage? Remember that SendMessage sends the
message and waits to the window to process it, but it can't do while it
is processing the current message.
Be careful about this situation:
Main receives "do push button" push button says itself "message: do it,
then continue". If things are like this and you send the message when
"do it" and after that is "then continue". If you do Sendmessage "do
it", it'll wait to "do it" to be done, but it can't if "then continue
isn't done" (Uhmm, the same would happen with the dummy window!!). If
you PostMessage then it would post "do it" and immediately it performs
"then continue", so it makes "then continue" before knowing the result
of "do it", so perhaps you would have to make: receive message (a) push
button posts message "do it" (b) and after do "do it" it posts "then
continue" (c), but perhaps it would need to happen that a=c, but with
some extra parameter so the program can distinguish beetwen the message
x being sent for start or for continue. Or perhaps, your program
performs steps that are not equivalent to this scheme and you don't need
worry about it.
Hope you get the perfect answer.
Geoff Baker wrote:
>I am trying to setup a Push Button control that when pushed, runs a series
>of commands, then calls itself to be run again. The reason behind this is
>that there is another thread that needs to process some data prior to the
>second half of the function being run. To do this I thought I could simply
>send a message to my main window (put the message into the que) so that once
>the other threads message has completed the button will be recalled.
>However this does not seem to happen, it simply ignores my sendmesage (or so
>it seems)
>
>Code:
> case 508:
> switch(setup)
> {
> case 0:
> FindSearch=FindInBuffer("]#",2);
> if(FindSearch==1)
> {
> MessageBox(NULL,"Prompt
>Check","Error",MB_OK|MB_ICONEXCLAMATION);
> }
> setup=1;
> break;
> case 1:
> FindInBuffer("]#",1);
> Command(" ",hwnd);
>
>SendMessage(hwnd,WM_COMMAND,(WPARAM)NULL,(LPARAM)508);
> break;
> }
> break;
>End Code:
>
>Does anyone know how to handle a situation like this?
>
>
>
>>Thanks
>>Geoff Baker
>>Systems Integration Technologist
>>
>>
>VCom (Formerly WaveCom)
>
>
>>150 Cardinal Place, Saskatoon, Sask. Canada S7L 6H7
>>Phone: (306)955-7075 Ext 489 Fax:(306)955-9919
>>Web Page: <http://www.vcom.com/>
>>
>>
>>
>>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
|