生成程序时,有时需要限制用系统中只有一个实例在运行,这就需要我们在检测到系统中已有程序的实例在运行时,将这个已经在运行的实例,激活并显示在用户面前这里主要用到了FindWindow ,和 SetForegroundWindow这两个函数 /// <
利用上了windows api,当一个窗体激活的时候会给另外一个发消息,具体实现如下: using System; using System.Windows.Forms; using System.Runtime.InteropServices; names
对话框ShowModal之后不能操作其它窗口,实际上是因为Windows Disable了其它窗口。所以当你需要在模态对话框中访问其它已经可见的窗口时,需要用EnableWindow API来激活对应的窗口。 例如: form2.showmodal; 在fo
1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnectio
//调用系统函数 将鼠标移动到相应位置 [DllImport("user32.dll", EntryPoint = "SetCursorPos")] public extern static bool SetCursorPos(int x, int y);
格)会被保留直到分割窗体本身被销毁;例如 Microsoft Excel 和 Microsoft Word都是这种风格的分割窗体; 当创建任意一种风格的分割窗体时,必须给定分割窗体的最大的行列数;静态风格的分割窗体,每个窗格必须被创建CSplitterWnd:
1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnecti
整理了一下常用的user32API说明 还有软件Microsoft Spy++供大家下载 Spyv10.00.30319.rar using System; using System.Collections.Generic; using System.Linq