WndProc e FindWindow

  • Thread starter Thread starter crino
  • Start date Start date
C

crino

Hi,
it's normal that findwindow() doesn't returns the same handler of
MessageWindow in CF??
if no...
why MessageWindow doesn't match with FindWindow??

thanks in advance ;)
 
in my main form i written:
internal class MsgWindow: MessageWindow
{
public MsgWindow()
{
}
protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case 5000:
break;
}
base.WndProc (ref m);
}
}
in form constructor:
msg = new MsgWindow();
IntPtr hwndInMain = msg.Hwnd;

in an other app i'm tring to send a message to the main application,
so:
IntPtr hwndOfMain = FindWindow(null, "MyApp");
if (hwndOfMain != IntPtr.Zero)
{
int ret = SendMessage(hwndOfMain, 5000, 1, 0);
}

why hwndOfMain is different of hwndInMain ??
 
Back
Top