上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 【程序1】 题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去 掉不满足条件的排列。 2.程序源代码: main() { int i,j,k; printf("\n"); for(i=1;i<5;i++) /*以下为三重循环*/ for(j=1;j<5;j++) for (k=1;k<5;k++) { if (i!=k&&i!=j&&j!=k) /*确保i、j、k三位互不相同*/ printf("%d 阅读全文
posted @ 2011-11-07 14:47 lanmiao 阅读(969) 评论(0) 推荐(0) 编辑
摘要: C# 如何让窗体永远显示在桌面上?桌面上层,不是永远置顶。实现桌面便签,桌面小工具,桌面天气预报功能!一、在最前面:using System.Runtime.InteropServices;在定义部分引入下面两个函数:[DllImport( "user32 ")]private static extern IntPtr FindWindow(string lpClassName,string lpWindowName);[DllImport( "user32 ")]private static extern IntPtr SetParent(IntPtr 阅读全文
posted @ 2011-11-06 17:34 lanmiao 阅读(6521) 评论(0) 推荐(2) 编辑
摘要: 接收拦截+发送消息对于处理所有消息.net 提供了wndproc进行重写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; retu 阅读全文
posted @ 2011-11-06 17:33 lanmiao 阅读(17141) 评论(0) 推荐(1) 编辑
摘要: C# 重写WndProc 拦截 发送 系统消息 + windows消息常量值(1) #region 截获消息 /// 截获消息 处理XP不能关机问题 protected override void WndProc(ref Message message) { switch (message.Msg) { case WM_QUERYENDSESSION: isClosed = true; break; } base.WndProc(ref message); } #endregionwindows 消息常量:windows消息大全消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生 阅读全文
posted @ 2011-11-06 17:32 lanmiao 阅读(9879) 评论(0) 推荐(2) 编辑
摘要: C#拦截系统消息的方法Application.AddMessageFilter Application.AddMessageFilter这个方法可以接收系统发出的消息: 首先定义一个类,继承IMessageFilter接口代码如下:internal class MyMessager : IMessageFilter{//截取消息,进行处理public bool PreFilterMessage(ref System.Windows.Forms.Message m){switch (m.Msg){case 513: //拦截左键单击事件 MessageBox.Show("左键被拦截.. 阅读全文
posted @ 2011-11-06 15:41 lanmiao 阅读(5276) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页