随笔分类 -  WindowsAPI

摘要:函数功能:该函数获取窗口客户区的坐标。客户区坐标指定客户区的左上角和右下角。由于客户区坐标是相对子窗口客户区的左上角而言的,因此左上角坐标为(0,0)函数原型:BOOLGetClientRect(HWNDhWnd,LPRECTlpRect);参数:GetLastError函数。备注:WindowsCE:命令条包含在客户区中。速查:WindowsNT:3.1以上版本:Windows:95以上版本:WindowsCE:1.0以上版本:头文件:winuser.h;库文件:user32.lib第一步,声明结构 publicstructRECT{publicuintLeft;publicuintTop. 阅读全文
posted @ 2012-07-17 15:35 ゞ追忆o0ゞ 阅读(6286) 评论(0) 推荐(0) 编辑
摘要:// 调用 AutoRegCom("regsvr32 -s dm.dll");staticstringAutoRegCom(stringstrCmd){stringrInfo;try{ProcessmyProcess=newProcess();ProcessStartInfomyProcessStartInfo=newProcessStartInfo("cmd.exe");myProcessStartInfo.UseShellExecute=false;myProcessStartInfo.CreateNoWindow=true;myProcessSta 阅读全文
posted @ 2012-07-13 16:18 ゞ追忆o0ゞ 阅读(769) 评论(0) 推荐(0) 编辑
摘要:原文地址在哪忘了,对不起额。publicclassWinIOLab{privateconstintKBC_KEY_CMD=0x64;privateconstintKBC_KEY_DATA=0x60;[DllImport("winio32.dll")]privatestaticexternboolInitializeWinIo();[DllImport("winio32.dll")]privatestaticexternboolGetPortVal(IntPtrwPortAddr,outintpdwPortVal,bytebSize);[DllImport 阅读全文
posted @ 2012-07-10 14:44 ゞ追忆o0ゞ 阅读(8628) 评论(4) 推荐(0) 编辑
摘要:WindowsAPI数据类型 C#数据类型BOOL System.Int32BOOLEAN System.Int32BYTE System.UInt16CHAR System.UInt16COLORREF System.UInt32DWORD System.UInt32DWORD32 System.UInt32DWORD64 System.UInt64FLOAT System.FloatHACCEL System.IntPtrHANDLE System.IntPtrHBITMAP System.IntPtrHBRUSH System.IntPtrHCON... 阅读全文
posted @ 2012-07-09 17:44 ゞ追忆o0ゞ 阅读(652) 评论(0) 推荐(0) 编辑
摘要:首先查看一下WindowsAPI给我们的解释函数功能:该函数改变指定窗口的位置和尺寸。对于顶层窗口,位置和尺寸是相对于屏幕的左上角的:对于子窗口,位置和尺寸是相对于父窗口客户区的左上角坐标的。函数原型:bool MoveWindow(HWND hWnd,int x,int y,int nWidth,int nHeight,bool BRePaint);参数:hWnd:窗口句柄。x:指定窗口的新位置的左边界。Y:指定窗口的新位置的顶部边界。nWidth:指定窗口的新的宽度。nHaight:指定窗口的新的高度。所在位置:user32.dll需要命名空间usingSystem;usingSystem 阅读全文
posted @ 2012-07-09 17:07 ゞ追忆o0ゞ 阅读(21576) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示