如何使用WndProc(ref Message msg) 方法??

bluenight88 bluenight88 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的設計工具: 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 ???



這裏就寫不下去了啊!哪位高手指教我一下啊!
...全文
评论 5
收藏 已收藏
分享
返回顶部
bluenight88
嵌入开发(WinCE) 19,524 成员 41,565 内容