如何使用WndProc(ref Message msg) 方法??
我的設計工具: VS2005 C# 智能設備。(windows ce 5.0)消息進行處理。在很多程序上,在msdn上也有是使用這個wndproc()方法接收消息。而且說明是windows ce 獨有的。現在我也把using Microsoft.WindowsCE.Forms; 引入了。
可是總是無法使用 protected override void WndProc(ref Message msg); 當我寫到 protected override void 這裏的時候,下拉菜單沒有WndProc 這個方法啊!
我的源代碼:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using Microsoft.WindowsCE.Forms;
namespace MyApplicationCe
{
public partial class Form1 : Form
{
public const int USER = 0x0400;
public const int TEST1 = USER + 1;
//api
[DllImport("coredll.dll")]
private static extern int SendMessage
(
IntPtr hWnd, // handle to destination window
uint Msg, // message
uint wParam, // first message parameter
uint lParam // second message parameter
);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SendMessage(this.Handle,TEST1,100,200);
}
protected override void ???
這裏就寫不下去了啊!哪位高手指教我一下啊!