PostMessage() public method

Post message to the thread. スレッドにメッセージを送る
public PostMessage ( int msg, IntPtr wParam, IntPtr lParam ) : void
msg int
wParam System.IntPtr
lParam System.IntPtr
return void
Exemplo n.º 1
0
 static void Main()
 {
     using (MessageThread thread = new MessageThread())
     {
         const int WM_COMMAND = 0x111;
         thread.MessageHandlers[WM_COMMAND] = (m) => { MessageBox.Show(m.Msg.ToString()); };
         thread.PostMessage(WM_COMMAND, IntPtr.Zero, IntPtr.Zero);
         Console.ReadLine();
     }
 }
Exemplo n.º 2
0
 static void Main()
 {
     using (MessageThread thread = new MessageThread())
     {
         const int WM_COMMAND = 0x111;
         thread.MessageHandlers[WM_COMMAND] = (m) => { MessageBox.Show(m.Msg.ToString()); };
         thread.PostMessage(WM_COMMAND, IntPtr.Zero, IntPtr.Zero);
         Console.ReadLine();
     }
 }