
Windows API
文章平均质量分 55
星江月
士不分心终有志,工能用力必成功!
展开
-
飞信聊天记录文件解密
前段时间,财务部的同事突然说飞信登录不了,经查发现飞信已经下线而和飞信既无聊天记录导入,也无导出功能,联系中国移动未解决建议不再使用此平台发送短信,然而数据还是要恢复的,因此... 注意:数据无价,执行代码前先对消息记录文件备份(位置:我的文档) 代码如下:// szKeyName 为密码, 微信账号(文件夹名称)int __stdcall FectionHist...原创 2019-01-17 11:51:02 · 2118 阅读 · 6 评论 -
Windows设备场景函数 - GetDC Ex
VB声明Declare Function GetDCEx Lib "user32" Alias "GetDCEx" (ByVal hwnd As Long, ByVal hrgnclip As Long, ByVal fdwOptions As Long) As Long说明为指定窗口获取设备场景。相比GetDC,本函数提供了更多的选项返原创 2009-09-23 01:25:00 · 1065 阅读 · 0 评论 -
Windows设备场景函数 - GetDC
VB声明Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long说明获取指定窗口的设备场景返回值Long,指定窗口的设备场景句柄,出错则为0参数表参数类型及说明hwndLong,将获取原创 2009-09-23 01:25:00 · 969 阅读 · 0 评论 -
Windows设备场景函数 - GetBoundsRect
VB声明Declare Function GetBoundsRect Lib "gdi32" Alias "GetBoundsRect" (ByVal hdc As Long, lprcBounds As RECT, ByVal flags As Long) As Long说明获取指定设备场景的边界矩形。每个设备场景都有一个边界矩形,程序员可用它来堆原创 2009-09-23 01:23:00 · 1166 阅读 · 0 评论 -
Windows绘图函数 - SetPixel
VB声明Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long说明在指定的设备场景中设置一个像素的RGB值返回值原创 2009-09-19 18:08:00 · 3125 阅读 · 5 评论 -
window位图光栅运算 - ExtractIcon
VB声明Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long说明判断一个可执行文件或DLL中原创 2009-09-19 16:19:00 · 736 阅读 · 0 评论 -
window位图光栅运算 - ExtractAssociatedIcon
VB声明Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociateIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long说明这个函数可判断一个原创 2009-09-19 16:14:00 · 675 阅读 · 0 评论 -
Windows硬件系统函数 - SetDoubleClickTime
VB声明Declare Function SetDoubleClickTime Lib "user32" Alias "SetDoubleClickTime" (ByVal wCount As Long) As Long说明设置连续两次鼠标单击之间能使系统认为是双击事件的间隔时间返回值Long,非零表示成功,零表示失败原创 2009-09-19 16:02:00 · 691 阅读 · 0 评论 -
Windows硬件系统函数 - GetSysColor
VB声明Declare Function GetSysColor Lib "user32" Alias "GetSysColor" (ByVal nIndex As Long) As Long说明判断指定windows显示对象的颜色返回值Long,指定对象的RGB颜色参数表参数类型及说明原创 2009-09-19 15:56:00 · 628 阅读 · 0 评论 -
Windows硬件系统函数 - GetCursorPos
VB声明Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long说明获取鼠标指针的当前位置返回值Long,非零表示成功,零表示失败。会设置GetLastError参数表参原创 2009-09-19 15:52:00 · 1028 阅读 · 0 评论 -
Windows硬件系统函数 - GetComputerName
VB声明Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long说明取得这台计算机的名称返回值Long,TRUE(非零)表示成功,否则返回零原创 2009-09-19 15:51:00 · 894 阅读 · 0 评论 -
Windows文本字体函数 - SetTextColor
VB声明Declare Function SetTextColor Lib "gdi32" Alias "SetTextColor" (ByVal hdc As Long, ByVal crColor As Long) As Long说明设置当前文本颜色。这种颜色也称为“前景色”返回值Long,文本色的前一个RGB颜色设定。C原创 2009-09-19 15:44:00 · 724 阅读 · 0 评论 -
Windows文本字体函数 - GetCharABCWidths
VB声明Declare Function GetCharABCWidths Lib "gdi32" Alias "GetCharABCWidthsA" (ByVal hdc As Long, ByVal uFirstChar As Long, ByVal uLastChar As Long, lpabc As ABC) As Long说明判断Ture原创 2009-09-19 15:39:00 · 904 阅读 · 0 评论 -
Windows文本字体函数 - EnumFonts
VB声明Declare Function EnumFonts Lib "gdi32" Alias "EnumFontsA" (ByVal hDC As Long, ByVal lpsz As String, ByVal lpFontEnumProc As Long, ByVal lParam As Long) As Long说明列举指定设备可用的字体原创 2009-09-19 15:36:00 · 1532 阅读 · 0 评论 -
Windows菜单函数 - ModifyMenu/ModifyMenuBynum
VB声明Declare Function ModifyMenu& Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As String)De原创 2009-09-19 15:34:00 · 1078 阅读 · 0 评论 -
Windows菜单函数 - DestroyMenu
VB声明Declare Function DestroyMenu Lib "user32" Alias "DestroyMenu" (ByVal hMenu As Long) As Long说明删除指定的菜单。如菜单属于另一个菜单的一部分,或直接分配给一个窗口,那么菜单会在窗口清除后被自动删除返回值Long,非零表示成功,零表原创 2009-09-19 15:30:00 · 738 阅读 · 0 评论 -
Windows网络函数 - WNetConnectionDialog
VB声明Declare Function WNetConnectionDialog Lib "mpr.dll" Alias "WNetConnectionDialog" (ByVal hwnd As Long, ByVal dwType As Long) As Long说明启动一个标准对话框,以便建立同网络资源的连接返回值Lo原创 2009-09-19 15:24:00 · 822 阅读 · 0 评论 -
Windows文件处理函数 - LockFileEx
VB声明Declare Function LockFileEx Lib "kernel32" Alias "LockFileEx" (ByVal hFile As Long, ByVal dwFlags As Long, ByVal dwReserved As Long, ByVal nNumberOfBytesToLockLow As Long, ByVal nNumbe原创 2009-09-19 15:17:00 · 1874 阅读 · 0 评论 -
Windows文件处理函数 - SetVolumeLabel
VB声明Declare Function SetVolumeLabel Lib "kernel32" Alias "SetVolumeLabelA" (ByVal lpRootPathName As String, ByVal lpVolumeName As String) As Long说明设置一个磁盘的卷标(Label)返回值原创 2009-09-19 15:23:00 · 1191 阅读 · 0 评论 -
关于消息循环
最近尝试在多线程里使用消息队列代替事件和临界区原因很简单,内核对象太多维护复杂,虽然处理消息队列的逻辑也很复杂,但相对维护一堆内核对象句柄要容易得多而且,不影响执行效率(消息队列自动销毁,创建只要调用一次相关的API即可,比如user32.dll的函数)然而奇怪的事情出现了,在几个线程空闲时CPU占用率很高代码诸如此类: while(True) { // 获原创 2016-12-28 11:16:32 · 798 阅读 · 0 评论 -
关于RECT结构体
先看看MSDN的说明:RECT StructureThe RECT data structure has the following form:typedef struct tagRECT { LONG left; LONG top; LONG right; LONG bottom;} RECT;The RECT structure de原创 2013-09-23 20:15:06 · 5158 阅读 · 2 评论 -
关于C/C++使用stdio读写文件的问题
用C实现一个html读取程序,其实就是个迷你“浏览器”。可以读取网页的html。然而遇到了似乎是jsp的站点,不过扩展名被重写为htm。它是用chunked方式分块发送html的搞了好久才正常解析这种http封包。为了调试,保存成文件,结果问题来了。 每个换行变成了0x0d 0x0d 0x0a,但是http首部和其他地方都正常,我原以为是网站程序员疏忽,程序了多写了个0x0d比原创 2013-02-27 20:29:57 · 1617 阅读 · 0 评论 -
详解vb字符串与C/C++动态库的交互
又是崭新的一年,大侠又来雷人了。 QQ版本更新以后,偶然翻看一下以前写的自动聊天机器人,居然不适用了!于是重写了个动态库,为String传递所困扰,于是决定借假期搞翻这颗钉子。 之前也写过关于参数传递的文章,不过对字符串的讲述很少,原因是我没亲自测试过,呵呵先说C/C++的两个函数:EXPORT_API DWORD __stdcall fnHook(DWORD dwIn原创 2013-01-02 01:38:12 · 3596 阅读 · 2 评论 -
Windows设备场景函数 - SetRectRgn
VB声明Declare Function SetRectRgn Lib "gdi32" Alias "SetRectRgn" (ByVal hRgn As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long说明设置区域为X1,Y1和原创 2009-09-23 01:28:00 · 808 阅读 · 0 评论 -
Windows设备场景函数 - AddFontResource
VB声明Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long说明在Windows系统中添加一种字体资源。添加完毕后,该字体即可由任何Windows应用程序调用返回值Lo原创 2009-09-23 01:19:00 · 1294 阅读 · 0 评论 -
Windows进程线程函数 - CreateProcess
VB声明Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpTh原创 2009-09-23 01:32:00 · 1124 阅读 · 0 评论 -
Windows设备场景函数 - DrawText
VB声明Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long说明将文原创 2009-09-23 01:22:00 · 726 阅读 · 0 评论 -
Windows设备场景函数 - CreateRectRgn
VB声明Declare Function CreateRectRgn Lib "gdi32" Alias "CreateRectRgn" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long说明创建一个由点X1,Y1和X2,Y2描述的矩形区域原创 2009-09-23 01:20:00 · 717 阅读 · 0 评论 -
Windows控件消息函数 - GetWindowLong
VB声明Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long说明从指定窗口的结构中取得信息返回值Long,由nIndex决定。零表示出错。会设置G原创 2009-09-19 16:11:00 · 1028 阅读 · 0 评论 -
Windows控件消息函数 - GetActiveWindow
VB声明Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long说明获得活动窗口的句柄返回值Long,活动窗口的句柄,如没有窗口处于活动状态,则返回零值原创 2009-09-19 16:09:00 · 828 阅读 · 0 评论 -
Windows控件消息函数 - FindWindow
VB声明Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long说明寻找窗口列表中第一个符合指定条件的顶级窗口(在vb里使用:FindWindow最常见原创 2009-09-19 16:06:00 · 815 阅读 · 0 评论 -
Windows硬件系统函数 - ExitWindowsEx
VB声明Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long说明退出windows,并用特定的选项重新启动返回值Long,非零表示成功,原创 2009-09-19 15:47:00 · 544 阅读 · 0 评论 -
Windows文本字体函数 - GetTextAlign
VB声明Declare Function GetTextAlign Lib "gdi32" Alias "GetTextAlign" (ByVal hdc As Long) As Long说明接收一个设备场景当前的文本对齐标志返回值Long,当前的文本对齐标志。GDI_ERROR表示失败。会设置GetLastError。文本的原创 2009-09-19 15:41:00 · 651 阅读 · 0 评论 -
Windows菜单函数 - CreatePopupMenu
VB声明Declare Function CreatePopupMenu Lib "user32" Alias "CreatePopupMenu" () As Long说明创建一个空的弹出式菜单。可用AppendMenu或InsertMenu函数在窗口中添加条目,或者为一个现成的菜单添加弹出式菜单,并在新建的菜单中添加条目返回值原创 2009-09-19 15:29:00 · 2442 阅读 · 0 评论 -
Windows文件处理函数 - UnlockFileEx
VB声明Declare Function UnlockFileEx Lib "kernel32" Alias "UnlockFileEx" (ByVal hFile As Long, ByVal dwReserved As Long, ByVal nNumberOfBytesToUnlockLow As Long, ByVal nNumberOfBytesToUnlockH原创 2009-09-19 15:22:00 · 862 阅读 · 0 评论 -
Windows文件处理函数 - SetFileTime
VB声明Declare Function SetFileTime Lib "kernel32" Alias "SetFileTime" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long原创 2009-09-19 15:19:00 · 1893 阅读 · 0 评论 -
Windows文件处理函数 - QueryDosDevice
VB声明Declare Function QueryDosDevice Lib "kernel32" Alias "QueryDosDeviceA" (ByVal lpDeviceName As String, ByVal lpTargetPath As String, ByVal ucchMax As Long) As Long说明在Windo原创 2009-09-19 15:16:00 · 1670 阅读 · 0 评论 -
Windows控件消息函数 - GetWindowRect
VB声明Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long说明获得整个窗口的范围矩形,窗口的边框、标题栏、滚动条及菜单等都在这个矩形内返回值Long,非零原创 2009-09-19 16:12:00 · 805 阅读 · 0 评论 -
Windows控件消息函数 - FlashWindow
VB声明Declare Function FlashWindow Lib "user32" Alias "FlashWindow" (ByVal hwnd As Long, ByVal bInvert As Long) As Long说明闪烁显示指定窗口。这意味着窗口的标题和说明文字会发生变化,似乎从活动切换到非活动状态、或反向切换。通常对不活动的窗原创 2009-09-19 16:08:00 · 1112 阅读 · 0 评论 -
Windows硬件系统函数 - SetCursorPos
VB声明Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long说明设置指针的位置返回值Long,非零表示成功,零表示失败。会设置GetLastError参数表原创 2009-09-19 16:02:00 · 882 阅读 · 0 评论