Click to See Complete Forum and Search --> : SendMessage to Main Thread


Dimension
March 21st, 2005, 03:02 AM
Hi,

I'm using Win32 API. I'm executing a worker Thread after launching application.
myThread = CreateThread(NULL, 0, SendStr, NULL, 0, &dw);

Now, from the Thread SendStr, I want to send Message back to Main Thread to execute something and return either TRUE or FALSE. How can I achieve that? Code example will be great. Thanks


DWORD WINAPI SendStr (LPVOID pParam)
{

if (something is TRUE)
// Send Message to Main Thread to execute something to check for the status TRUE or FALSE

}

Andreas Masur
March 21st, 2005, 03:10 AM
[ Moved thread ]

Andreas Masur
March 21st, 2005, 03:10 AM
Take a look at the following FAQ (http://www.codeguru.com/forum/showthread.php?t=312454)...

Dimension
March 21st, 2005, 03:16 AM
I'm not familiar with MFC.

Can u show in Win32 format ?

Andreas Masur
March 21st, 2005, 04:41 AM
Although the example in the FAQ is a MFC application...the sending of the message is done using the API.... ;)

What is the purpose of your message? Updating GUI?

kuphryn
March 21st, 2005, 09:52 AM
Check out MSDN.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_api_reference.asp

Kuphryn