VB老皇历
文章平均质量分 93
barenx
Art of Life
展开
-
VB实现抓屏/截图的代码
Attribute VB_Name = "ModuleCapturePic"Option ExplicitOption Base 0Powered by barenxPrivate Type PALETTEENTRY peRed As Byte peGreen As Byte peBlue As Byte peFlags As ByteEnd TypePrivate Type原创 2008-03-28 09:49:00 · 5462 阅读 · 0 评论 -
VB 注册表操作模块 代码
Attribute VB_Name = "Reg_Operation"这是一个操作注册表的Bas文件,其中包含可以建立新键值,删除键值,查询键值的函数.Powered by barenxOption ExplicitOption Base 0Public Declare Function RegCloseKey()Function RegCloseKey Lib "advapi32.dll"原创 2008-03-29 13:23:00 · 1623 阅读 · 0 评论 -
VB Shell32 的外壳函数库 代码
Attribute VB_Name = "Shell32Function"Option ExplicitPrivate Declare Sub CopyMemory()Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Long, pSrc As Long, ByVal ByteLen As Long)Private De原创 2008-03-29 13:26:00 · 1672 阅读 · 0 评论 -
VB Shell HOOK 代码
Attribute VB_Name = "Module1"Option ExplicitPrivate Declare Function RegisterShellHook()Function RegisterShellHook Lib "Shell32" Alias "#181" (ByVal hwnd As Long, ByVal nAction As Long) As Long use原创 2008-03-29 15:09:00 · 2961 阅读 · 0 评论 -
VB 系统待机 代码
Private Declare Function SetSuspendState()Function SetSuspendState Lib "Powrprof" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, ByVal DisableWakeEvent As Boolean) As BooleanPowered b原创 2008-03-29 15:35:00 · 1623 阅读 · 0 评论 -
VB WMI 对象的示例代码
Attribute VB_Name = "ModuleWMI" Powered by barenxOption ExplicitPrivate Declare Function ExpandEnvironmentStrings()Function ExpandEnvironmentStrings Lib "kernel32" Alias "ExpandEnvironmentStri原创 2008-03-29 16:23:00 · 1898 阅读 · 0 评论 -
VB 调用系统API 选择文件夹 代码
Option ExplicitPowered by barenxPrivate Declare Function SHBrowseForFolder()Function SHBrowseForFolder Lib "shell32.dll" Alias _ "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As LongPr原创 2008-03-29 16:31:00 · 2088 阅读 · 0 评论 -
一段弃暗投明的代码
Attribute VB_Name = "MainModule"Option ExplicitOption Base 0 Powered by barenxPrivate Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String原创 2008-03-29 16:39:00 · 1468 阅读 · 0 评论 -
VB 高效连接字符串 代码
Dim s As String s = String$(255, vbNullChar) Mid$(s, 1, 5) = "12345" Mid$(s, 6, 7) = "abcdefg" Debug.Print sPowered by barenx 对于vb来说string类型实质是oleString 在进行连接的时候都有再次分配内存 然后复制原字原创 2008-03-29 17:04:00 · 2895 阅读 · 0 评论 -
VB 监视文件改变 代码
Attribute VB_Name = "mShellNotify"Option Explicit Brought to you by Brad Martinez http://members.aol.com/btmtz/vb http://www.mvps.org/ccrp Code was written in and formatted for 8pt MS San Se原创 2008-03-29 17:49:00 · 3128 阅读 · 0 评论 -
Ms-0419 权限提升 代码
VERSION 5.00Begin VB.Form Form1 Appearance = 0 Flat BackColor = &H80000015& Caption = "MS-04" ClientHeight = 1350 ClientLeft = 60 ClientTop原创 2008-03-30 10:34:00 · 935 阅读 · 0 评论 -
VB 枚举窗口和关闭程序窗口的代码
Attribute VB_Name = "Enum_Window"Option ExplicitOption Base 0Powered by barenxPublic Declare Function FindWindow()Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String原创 2008-03-28 09:53:00 · 3088 阅读 · 4 评论 -
用VB编写基于控制台的程序
设计思路 (1)分配控制台程序的内存资源。 (2)设置控制台的相关属性。 (3)通过控制台输出文本内容。 (4)接收交互信息并继续输出。 (5)释放控制台程序的内存并关闭程序。实现步骤 (1)启动VB,新建一个工程,删除默认的“From1”窗体,然后添加一个模块,在该模块中输入常量和全局变量的定义代码。 注:API函数的声明可参照“本期API函数声明”转载 2008-03-31 22:09:00 · 5823 阅读 · 0 评论 -
VB取硬盘的物理序列号
网上有很多获取硬盘序列号的代码,大部分都只能取得逻辑分区的序列号,而不能取得硬盘的物理序列号;或虽然能取得物理序号,但需要外带一个VC编写的DLL文件......我们知道,逻辑分区的序列号是FORMAT时产生的,重新FORMAT将会改变,这对于要求唯一识别码的程式来说是致命的。下面的 VB 代码利用 Windows API 可以取得物理硬盘的很多特性,包括硬盘出厂时的唯一编号。这段代码我是从 CS转载 2008-03-31 22:36:00 · 3242 阅读 · 0 评论 -
如何让VB调用外部的DLL
collected by barenxWindows动态连接库是包含数据和函数的模块,可以被其它可执行文件(EXE、DLL、OCX 等)调用。动态连接库包含两种函数:输出(exported)函数和内部(internal)函数。输出函数可以被其它模块调用,而内部函数则只能在动态连接库内部使用。尽管动态连接库也能输出 数据,但实际上它的数据通常是只在内部使用的。使用动态连接库的优点是显而易见的转载 2008-03-31 22:40:00 · 8529 阅读 · 0 评论 -
用VB命令实现多个文件的拷贝工作
下面是一个例子显示如何拷贝文件: 1. 在Visual Basic中启动一个新的EXE工程,其中包括Form1。 2. 添加两个检查框和一个按钮在Form1上。 3. 加入以下代码到Form1的代码窗口: Option Explicit Private Const FO_COPY = &H2& Copies the f转载 2008-03-31 21:47:00 · 3974 阅读 · 0 评论 -
VB在程序中注册热键
collected by barenx Option ExplicitPrivate Sub Form_Load()Sub Form_Load()Dim ret As Long 记录原来的window程序地址 preWinProc = GetWindowLong(Me.hWnd, GWL_WNDPROC) 用自定义程序代替原来的window程序 ret =转载 2008-03-31 22:11:00 · 1381 阅读 · 1 评论 -
VB实现的FileStream代码
Powered by barenx Global Memory FlagsPrivate Const GMEM_MOVEABLE = &H2Private Const GMEM_ZEROINIT = &H40Private Const GENERIC_READ = &H80000000Private Const FILE_SHARE_READ = &H1Private Const OPEN原创 2008-03-29 13:21:00 · 2689 阅读 · 0 评论 -
VB 创建可等待进程并获取Stdout输出的代码
Attribute VB_Name = "Run_Command"Option ExplicitOption Base 0Powered by barenxPrivate Declare Function CreateProcess()Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplica原创 2008-03-29 13:17:00 · 1319 阅读 · 0 评论 -
VB 利用API创建窗体的模块代码
Public Declare Function RegisterClass()Function RegisterClass Lib "user32" Alias "RegisterClassA" (Class AsClass As WNDCLASS) As LongPublic Declare Function UnregisterClass()Function UnregisterClass原创 2008-03-29 02:21:00 · 6587 阅读 · 0 评论 -
VB 关闭计算机 代码
需要提升进程权限的模块Attribute VB_Name = "Exit_Windows"Option ExplicitOption Base 0Powered by barenxPrivate Declare Function ExitWindowsEx()Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByV原创 2008-03-29 02:32:00 · 1441 阅读 · 0 评论 -
在XP/2K系统中隐藏进程的VB代码
在XP/2K系统中隐藏进程的VB代码Attribute VB_Name = "modHideProcess"-------------------------------------------------------------------------------------模块名称:modHideProcess.bas模块功能:在 XP/2K 任务管理器的进程列表中隐藏转载 2008-03-28 00:04:00 · 1132 阅读 · 1 评论 -
VB 位图类
VERSION 1.0 Class BEGINCLASSBEGIN MultiUse = -1 TrueENDAttribute VB_Name = "cDIBSection"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribut原创 2008-03-28 09:51:00 · 1541 阅读 · 0 评论 -
VB CreateProcess代码
Attribute VB_Name = "Run_Command"Option ExplicitOption Base 0Powered by barenxPrivate Declare Function CreateProcess()Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplica原创 2008-03-28 10:28:00 · 4690 阅读 · 0 评论 -
VB 精确计时类 代码
VERSION 1.0 Class BEGINCLASSBEGIN MultiUse = -1 True Persistable = 0 NotPersistable DataBindingBehavior = 0 vbNone DataSourceBehavior = 0 vbNone MTSTransactionMode = 0 NotAnMTSOb原创 2008-03-29 02:16:00 · 1601 阅读 · 0 评论 -
VB Base64编码类 代码
Attribute VB_Name = "ModBase64"Option ExplicitPowered by barenxPublic key(1 To 3) As LongPrivate Const base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"Public Sub GenKey()原创 2008-03-29 02:18:00 · 2027 阅读 · 0 评论 -
VB 获取所有逻辑磁盘信息 代码
Attribute VB_Name = "ModuleDiskInfo"Option ExplicitPowered by barenxPrivate Const DRIVE_CDROM = 5Private Const DRIVE_FIXED = 3Private Const DRIVE_RAMDISK = 6Private Const DRIVE_REMOTE = 4Private Co原创 2008-03-29 02:24:00 · 1410 阅读 · 0 评论 -
VB 进程权限提升 代码
Attribute VB_Name = "Enable_Privileges"Option ExplicitOption Base 0Powered by barenxPrivate Declare Sub CloseHandle()Sub CloseHandle Lib "kernel32" (ByVal hPass As Long)Private Declare Function L原创 2008-03-29 02:25:00 · 2021 阅读 · 0 评论 -
VB 获取进程/模块信息 批量结束进程的代码
Attribute VB_Name = "Enume_Task"Option ExplicitOption Base 0Powered by barenxPrivate Declare Function GetSystemDirectory()Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (B原创 2008-03-29 02:29:00 · 2464 阅读 · 0 评论 -
VB INI 读写类 代码
VERSION 1.0 Class BEGINCLASSBEGIN MultiUse = -1 True Persistable = 0 NotPersistable DataBindingBehavior = 0 vbNone DataSourceBehavior = 0 vbNone MTSTransactionMode = 0 NotAnMTSOb原创 2008-03-29 02:35:00 · 1109 阅读 · 0 评论 -
VB 系统托盘模块 代码
Attribute VB_Name = "ModFromClass"Option ExplicitPowered by barenxPublic Declare Function SetWindowPos()Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVa原创 2008-03-29 02:37:00 · 1431 阅读 · 0 评论 -
JPG 操作模块 代码
Attribute VB_Name = "mIntelJPEGLibrary"Option ExplicitPowered by barenxPrivate Enum IJLERREnum IJLERR // The following "error" values indicate an "OK" condition. IJL_OK = 0 IJL_INTERRUPT_OK = 1原创 2008-03-29 02:40:00 · 1950 阅读 · 0 评论 -
VB 使用未注册的ActiveX 代码
(声明:魏滔序原创,转贴请注明出处。)阿国哥的代码(找到链接后再补上),我稍微改良了一下,做绿色软件的朋友肯定用的到。IDE下可以引用那个dll使用。编译后可以在未注册dll的计算机上正常工作了。使用方法:Dim pDll As Long 记录Dll,用来最后完美释放Dim Update As Update.Handle 要实例化的对象Set Update = LoadObj转载 2008-03-29 02:42:00 · 1802 阅读 · 0 评论 -
VB 程序控件自适应XP主题
Attribute VB_Name = "modManifest"Option ExplicitPrivate Declare Function GetVersionEx()Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As LongPriva转载 2008-03-29 02:45:00 · 1415 阅读 · 0 评论 -
VB 内存分配与流读写 代码
Option ExplicitPrivate Declare Function VirtualAlloc()Function VirtualAlloc Lib "kernel32" (ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As原创 2008-03-29 13:01:00 · 2479 阅读 · 0 评论 -
VB调用API post数据
Option ExplicitAuthor: Sam HuggillEmail: sam@vbsquare.comcollected by barenxPrivate Declare Function InternetOpen Lib "wininet.dll" _ Alias "InternetOpenA" _ (ByVal lpszCa转载 2008-04-03 02:36:00 · 1776 阅读 · 0 评论