2012年11月30日

WndProc(ref Message m)

摘要: WndProc(ref Message m)protected override void WndProc(ref Message m){ const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (m.Msg == WM_SYSCOMMAND && (int) m.WParam == SC_CLOSE) { // 屏蔽传入的消息事件 this.WindowState = FormWindowState.Minimized; return; } ... 阅读全文

posted @ 2012-11-30 14:27 SuperCai 阅读(752) 评论(0) 推荐(0) 编辑

[转]DllImport属性详解

摘要: DllImport属性详解(http://blog.csdn.net/yyz_2637/article/details/5340365)API函数是构筑Windows的基石, 是Windows编程的必备利器。每一种Windows应用程序开发工具都提供间接或者直接的方式调用Win32API,C#也不例外。使用Win32API的一个好处就是,我们可以实现更多的功能。首先,要引入命名空间:using System.Runtime.InteropServices;然后,声明在程序中所要用到的API函数。注意方法体为空。DllImport属性用于指定包含外部方法的实现的dll位置。(1)DllImpor 阅读全文

posted @ 2012-11-30 14:13 SuperCai 阅读(1528) 评论(0) 推荐(0) 编辑

导航