Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: to send message to console exe Pin
Rajesh R Subramanian26-Nov-11 22:25
professionalRajesh R Subramanian26-Nov-11 22:25 
AnswerRe: to send message to console exe Pin
CPallini26-Nov-11 22:39
mveCPallini26-Nov-11 22:39 
AnswerRe: to send message to console exe Pin
Chuck O'Toole27-Nov-11 5:28
Chuck O'Toole27-Nov-11 5:28 
AnswerRe: to send message to console exe Pin
Randor 27-Nov-11 5:52
professional Randor 27-Nov-11 5:52 
GeneralRe: to send message to console exe Pin
CPallini27-Nov-11 6:01
mveCPallini27-Nov-11 6:01 
GeneralRe: to send message to console exe Pin
Erudite_Eric27-Nov-11 6:57
Erudite_Eric27-Nov-11 6:57 
QuestionRe: to send message to console exe Pin
Randor 27-Nov-11 7:49
professional Randor 27-Nov-11 7:49 
GeneralRe: to send message to console exe Pin
Software_Developer27-Nov-11 8:56
Software_Developer27-Nov-11 8:56 
C#
#include <windows.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
#pragma comment(lib, "user32")

int main(int argc, char *argv[], char *envp[]) 
{
	DWORD idThread;
	MSG Msg;
	if (argc == 2) 
	{
		idThread = atoi(argv[1]);
		if (!PostThreadMessage(idThread, WM_COMMAND, (WPARAM)0, (LPARAM)0))
			cout << GetLastError() << " PostThreadMessage error\n";
		return 0;
	}
	cout << GetCurrentThreadId() << " thread id\n";

	while (GetMessage(&Msg, NULL, 0, WM_USER)) 
	{
		if (Msg.message == WM_COMMAND)
			cout << "WM_COMMAND\n";
		else
			cout << "Message: " << Msg.message << endl;
	}
return 0;
}

GeneralRe: to send message to console exe Pin
Randor 27-Nov-11 9:06
professional Randor 27-Nov-11 9:06 
GeneralRe: to send message to console exe Pin
Richard Andrew x6427-Nov-11 9:57
professionalRichard Andrew x6427-Nov-11 9:57 
GeneralRe: to send message to console exe Pin
Randor 27-Nov-11 11:15
professional Randor 27-Nov-11 11:15 
GeneralRe: to send message to console exe Pin
Albert Holguin28-Nov-11 7:46
professionalAlbert Holguin28-Nov-11 7:46 
AnswerRe: to send message to console exe Pin
Software_Developer27-Nov-11 7:46
Software_Developer27-Nov-11 7:46 
AnswerRe: to send message to console exe Pin
David Crow27-Nov-11 11:03
David Crow27-Nov-11 11:03 
QuestionDifferent GUI rendereng between WinXP and Vista-Win7 Pin
Bram van Kampen26-Nov-11 14:38
Bram van Kampen26-Nov-11 14:38 
Questionhow to read a character array line by line in C? Pin
robin70025-Nov-11 14:38
robin70025-Nov-11 14:38 
AnswerRe: how to read a character array line by line in C? Pin
robin70025-Nov-11 18:49
robin70025-Nov-11 18:49 
GeneralRe: how to read a character array line by line in C? Pin
enhzflep25-Nov-11 21:35
enhzflep25-Nov-11 21:35 
AnswerRe: how to read a character array line by line in C? Pin
Richard MacCutchan25-Nov-11 22:24
mveRichard MacCutchan25-Nov-11 22:24 
AnswerRe: how to read a character array line by line in C? Pin
CPallini26-Nov-11 0:45
mveCPallini26-Nov-11 0:45 
GeneralRe: how to read a character array line by line in C? Pin
enhzflep26-Nov-11 0:59
enhzflep26-Nov-11 0:59 
GeneralRe: how to read a character array line by line in C? Pin
CPallini26-Nov-11 1:11
mveCPallini26-Nov-11 1:11 
QuestionWaitForSingleObject, Run do loop, win32 api Pin
jkirkerx25-Nov-11 13:44
professionaljkirkerx25-Nov-11 13:44 
AnswerRe: WaitForSingleObject, Run do loop, win32 api Pin
Chris Meech25-Nov-11 14:13
Chris Meech25-Nov-11 14:13 
GeneralRe: WaitForSingleObject, Run do loop, win32 api Pin
jkirkerx25-Nov-11 15:18
professionaljkirkerx25-Nov-11 15:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.