Click here to Skip to main content
15,912,665 members
Home / Discussions / C#
   

C#

 
GeneralRe: Code review wanted Pin
Emma Burrows2-Jun-06 22:16
Emma Burrows2-Jun-06 22:16 
AnswerRe: Code review wanted Pin
leppie2-Jun-06 9:39
leppie2-Jun-06 9:39 
GeneralRe: Code review wanted Pin
Emma Burrows2-Jun-06 22:15
Emma Burrows2-Jun-06 22:15 
AnswerRe: Code review wanted Pin
Emma Burrows10-Jun-06 1:03
Emma Burrows10-Jun-06 1:03 
QuestionHow to use user32.dll PostMessage function. Pin
Larantz2-Jun-06 2:02
Larantz2-Jun-06 2:02 
AnswerRe: How to use user32.dll PostMessage function. Pin
Ravi Bhavnani2-Jun-06 2:33
professionalRavi Bhavnani2-Jun-06 2:33 
General[Solved it]Re: How to use user32.dll PostMessage function. [modified] Pin
Larantz2-Jun-06 3:06
Larantz2-Jun-06 3:06 
GeneralRe: How to use user32.dll PostMessage function. Pin
Larantz2-Jun-06 3:33
Larantz2-Jun-06 3:33 
Hi again ravi.

I was hoping you might explain to me why the messages I send from
"senderclass" isn't picked up by the "recieverclass".

All I can think of is that the pointer to the process is wrong.
But I know that Process.GetprocessByName("processname") finds the right process.

Here's the code for the PostMessage routines:
//Helperclass
[DllImport("User32.Dll")]
public static extern long PostMessage(IntPtr hWnd, long wMsg, long wParam, long lParam);

public const long WM_PAINT = 0x0F;
public const long WM_DISPLAYCHANGE = 0x7E;


//Sender class
System.Diagnostics.Process[] procs = Process.GetProcessesByName("processname_here");
foreach(System.Diagnostics.Process proc in procs)
{
	Helpers.PostMessage(proc.Handle, Helpers.WM_PAINT, 0, 0);
}


//Reciever class
protected override void WndProc(ref Message m)
{
	base.WndProc(ref m);

	if (m.Msg == WM_PAINT) //This draws for WM_PAINT messages from the system, but not when I send it from senderclass.
	{
		MessageBox.Show("Got message");
	}
}


Thanks in advance,

-Larantz-
GeneralRe: How to use user32.dll PostMessage function. Pin
e87t53iu19-Oct-09 21:56
e87t53iu19-Oct-09 21:56 
QuestionEmpty DataSet??? Pin
NaNg152412-Jun-06 1:20
NaNg152412-Jun-06 1:20 
AnswerRe: Empty DataSet??? Pin
H. Neville III2-Jun-06 3:06
H. Neville III2-Jun-06 3:06 
QuestionRe: Empty DataSet??? Pin
NaNg152412-Jun-06 3:25
NaNg152412-Jun-06 3:25 
AnswerRe: Empty DataSet??? Pin
H. Neville III2-Jun-06 3:51
H. Neville III2-Jun-06 3:51 
AnswerRe: Empty DataSet??? Pin
Dustin Metzgar2-Jun-06 3:11
Dustin Metzgar2-Jun-06 3:11 
QuestionRe: Empty DataSet??? Pin
NaNg152412-Jun-06 3:25
NaNg152412-Jun-06 3:25 
AnswerRe: Empty DataSet??? [modified] Pin
Dustin Metzgar2-Jun-06 3:44
Dustin Metzgar2-Jun-06 3:44 
GeneralRe: Empty DataSet??? [modified] Pin
NaNg152412-Jun-06 5:17
NaNg152412-Jun-06 5:17 
GeneralRe: Empty DataSet??? Pin
Dustin Metzgar2-Jun-06 5:27
Dustin Metzgar2-Jun-06 5:27 
QuestionMs Project Ole Db Pin
Philippe Generet2-Jun-06 0:50
Philippe Generet2-Jun-06 0:50 
AnswerRe: Ms Project Ole Db Pin
Emma Burrows2-Jun-06 2:53
Emma Burrows2-Jun-06 2:53 
QuestionUrgent Pin
Shiv52-Jun-06 0:47
Shiv52-Jun-06 0:47 
AnswerRe: Urgent Pin
Colin Angus Mackay2-Jun-06 1:45
Colin Angus Mackay2-Jun-06 1:45 
GeneralRe: Urgent Pin
led mike2-Jun-06 6:57
led mike2-Jun-06 6:57 
QuestionHow to handle toolbar control? Pin
maaran2-Jun-06 0:34
maaran2-Jun-06 0:34 
AnswerRe: How to handle toolbar control? Pin
Darren_2-Jun-06 0:43
Darren_2-Jun-06 0:43 

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.