VB API函数大全


|

| Show the "Save File" Common Dialog

显示“保存文件”对话框

Show the "Browse Folder" Common Dialog

显示“浏览文件夹”对话框

Suspend a Computer

挂起计算机

Test if an application is responding and terminate application

测定一个应用程序是响应还是终止(以IE为例)。

Test if an application is responding and terminate application

(续:)测定一个应用程序是响应还是终止

Format a floppy disk

格式化软盘

Zero a portion of an array

清零一个数组

Determine the free space on a drive

测定驱动器上的空闲空间

Edit the files stored in the "Documents" menu

编辑保存在文档菜单的文件

Copy files using the File Copy Shell

使用File Copy Shell,拷贝文件

Show the "File Open" Common Dialog

显示“文件打开”对话框

Converting Class IDs to a Prog IDs and back

转变class ID到一个prog ID

Obtaining the current user name

获得当前用户名

Return the path of the temporary directory

返回临时目录的路径

Return the path of the windows directory

返回windows目录的路径

Return the path of the system directory

返回system目录的路径

Create a GUID

创建一个GUID

Enable and Disable the windows task bar

激活和禁止windows任务条

Determining the system folder locations

设定system文件夹的位置

Obtaining information about the operating system

获得操作系统的信息

Find the path of the executable associated with a file

找到文件的完整路径

Locking the application screen area

锁住应用程序客户区。

Lock All GUI updating

阻止所有的GUI更新

Changing the screen resolution/colors

改变screen颜色

Convert a pointer to a string into a string

返回指向的字符串

Associate a file with a file extension

给文件扩展名关联打开文件

Shutdown/restart/logoff the local machine

关机,重启动,注销,本地计算机

Display the "Setup Prompt for Disk" dialog

显示“Setup Prompt for Disk”对话框

Display the "Setup Reboot" dialog

显示“Setup Reboot”对话框

Perform a recursive search for a file or pattern using API

使用api递归查找文件

Block keyboard and mouse input to an application

一个阻塞键盘和鼠标输入的应用程序

Return a dialog handle/class name from a caption

从标题栏里返回对话框的句柄名

Restrict the movement of a cursor to a specified area

限制鼠标指针的运动区域

Encrypt a file/folder (Windows 2000)

加密文件/文件夹(Windows 2000适用)

Setting the tab positions in a listbox

在列表框里设置tab的位置

Find an item in a listview

查找列表框的一项

Get a list of file version details for OCX, EXE and DLL files

得到一个OCX, EXE and DLL 文件的详细版本信息

Get and set a dialogs caption/title

取得和设置一个对话框标题

Controlling the clipboard (inc. clear, copy and query)

控制剪贴板

Get and set the list area width of a combo box

得到和设置一个组合框的列表宽度

Change to priority level of the current process

改变当前线程的优先级

Show the "System Settings Changed, Restart Computer?" dialog

显示“System Settings Changed, Restart Computer?”对话框

Creating new threads to perform asynchronous tasks

创建一个新的线程执行异步任务

Get and set volume information for a drive

得到和设定驱动器的卷信息

Using the ShellExecute API to send mails and print documents

使用ShellExecute API发送email和打印文档

Get the error message associated with and API error number

用API error 号表示错误消息

Save a screen snapshot to a bitmap

用bitmap格式保存一个屏幕快照。

Load and Save Images to a Database

在数据库里读出和保存图象

Changing a files created, modified and accessed times.

改变文件创建和修改,保存时间

Changing a files created, modified and accessed times.

(续)改变文件创建和修改,保存时间

Show system shut down/restart dialog

显示系统,关闭/重启 对话框

Checking to see if an application is already running

检查应用程序是否已运行

Search a folder (and all it's subfolders) for a file

在一个文件夹里搜查一个文件

Create a name for a temporary file

为临时文件创建一个名城

View the contents of a block of memory

显示某块内存的内容

List/Enumerate all the OCX Controls installed on a computer

列举安装在计算机里的所有ocx控件

Returning an ExitCode parameter from an out of process application

从外部应用程序返回参数

Check if a loggin password and user name are correct

检查当前登录的密码和用户名是不是正确的。

Removing an item from a 1d array

在一维数组中移动一个元素

Changing the type of input a textbox can receive

改变文本框输入的类型(比如只能输入数字)

Changing the way a form is repainted while being dragged

改变拖动时窗口的重画方式

Terminate a Process

终止一个进程

Making a textbox resizable

建立可变尺寸的文本框

Swap the left and right mouse buttons over

按下按钮交换左由鼠标键。

Controlling the position of a MsgBox

控制MsgBox函数弹出消息框的位置

Returning the windows handle of a dialog at a specified point

返回指向对话框的句柄

Returning a files creation time

返回,文件的创建时间

Adding custom system menu items to forms

给窗体加上定制的系统菜单

Register Components without using Regsvr32.exe

不使用Regsvr32.exe注册组件

Uncover internal DLL functions with Dependency Walker

公布内部调用的dll函数

Launch a PC's default browser with ShellExecute API

用ShellExecute API函数,启动默认的浏览器

Get File Version Information Details (OCX, EXE, DLL etc)

得到详细的文件版本信息,

Create a timer using API calls

使用api创建一个时钟。

Play an audio file

播放音频文件

Set and get a Computer's name

设置和得到计算机名

Shell and wait for a process to finish

启动并等待一个进程结束

Make the current process pause/sleep for a specified time period

指定当前进程挂起时间

Determine system memory status

测定系统的内存状态

Send files to the Recycle bin

把文件送入回收站

Get a list of the system processes

得到系统进程的列表

Redim Preserve a 2d array

重定义2维数组

Turn the Screen Saver on or off

启动或禁止Screen Saver

Return the error message associated with Err.LastDllError

返回带Err.LastDllError的错误消息

Turn the monitor on and off

启动或禁止监视器

Show the "Choose a Color" Common Dialog

显示“选择颜色”对话框

Show the "Select a Font" Common Dialog

显示“选择字体”对话框

Show the Windows "Run" Dialog

显示windows“运行”对话框

Change Date Format of the system

改变系统的日期格式

Change your Novell Password

改变你的Novell密码

Shutdown your computer using ExitWindowEx API Call

使用ExitWindowEx API 关闭你的计算机

Adding AutoComplete to a VB Text Box

给VB文本框加入自动完成功能

当组合框得到焦点时下拉组合框列表

this makes form transperent only controls are visible

制作仅控件可见的透明窗体

Map and Unmap network drives using Windows "Map Network Drives" dialog

使用Windows “Map Network Drives”对话框,映射和不映射网络驱动器

Simple Code to Map a Network Drive

映射一个网络驱动器,的简单代码

Get your Computer name using GetComputerName API

使用GetComputerNameapi得到你的计算机名

Get your windows system directory using GetSystemDirectory API

使用GetSystemDirectory API得到windows的系统目录

Get your windows temp directory using GetTempPath API

使用GetTempPath API得到windows的临时目录

Get your windows directory using GetWindowsDirectory API

使用GetWindowsDirectory API得到windows目录

Set your computer name using SetComputerName API

使用SetComputerName API设置你的计算机名

Clear the recent documents menu using SHAddToRecentDocs API

使用SHAddToRecentDocs API清除最近的文档菜单

Add a file to recent documents menu using SHAddToRecentDocs API

使用SHAddToRecentDocs API加一个文件到最近的文档菜单

To show/hide cursor using

显示/隐藏鼠标指针。

Swap the mouse button using SwapMouseButton API

使用SwapMouseButton API交换鼠标按钮

Connect or disconnect a network drive

连接或断开网络驱动器

Connect or disconnect a LPT port

连接或断开一个LPT端口

Display the windows About Box using ShellAbout API

使用ShellAbout API函数显示windows关于对话框

Get logged in username using GetUserName API

使用GetUserName API得到登录者的用户名

Get network logged in username using WNetGetUser API

使用WNetGetUser API得到网络的登录用户名

Copy a file using CopyFile API

使用CopyFile API copy一个文件

Move a file using MoveFile API

使用MoveFile API移动一个文件

Some API funcitons to move, hide/show the mouse

一些API函数,移动,隐藏/显示鼠标

This Includes ALL of Karthikeyans API Code into module-type procedures.

在模块里包括所有的Karthikeyans API代码

Some API functions for hiding/showing/moving the mouse, etc... enjoy.

一些API函数,隐藏/显示/移动 鼠标等等。

Code to Display the % of Memory in Use

显示内存使用%的例子

choose the frequency and duration of sounds from the internal speaker

选择频率和持续时间,让内置扬声器发声

Put your application to sleep for a certain number of milliseconds.

让你的应用程序睡眠指定的秒数

Find out whether or not a laptop is running on battery power and if so how much battery time is remaining.

测定手提式电脑是否在使用电池运行,并且测试出它的剩于电池量

Find out the processor type of a system and the total number of processors in a machine

测定系统的cpu类型,和机器里cpu的个数。

Find Files using FindFirstFile,FindNextFile and FindClose API

使用FindFirstFile,FindNextFile and FindClose API查找文件

Show,Hide,Maximize,Minimize,Restore and more with ShowWindow API

ShowWindow API显示,隐藏,最大化,最小化,恢复。

Set window text using SetWindowText API

使用SetWindowText API设置控件窗口的文本

Set Disk Volume Label using SetVolumeLabel API

使用SetVolumeLabel API设置磁盘卷标

Set System Cursor using SetSystemCursor API

使用SetSystemCursor API设置系统鼠标

Get File Attributes using GetFileAttributes API

使用GetFileAttributes API得到文件属性

Set File atrributes using SetFileAttributes API

使用SetFileAttributes API设置文件属性

Get Environment Variable using GetEnvironmentVariable using API

使用GetEnvironmentVariable API,得到环境变量

Set Environment Variable using SetEnvironmentVariable API

使用SetEnvironmentVariable API,设置环境变量。

Remove Directory using RemoveDirectory API

使用RemoveDirectory API,移动目录

Create Directory using CreateDirectory API

使用CreateDirectory API,创建目录

Play system sounds using MessageBeep API

使用MessageBeep API播放系统声音

Get Current Greewich Mean Time using GetSystemTime API

使用GetSystemTime API得到当前的Greewich时间

Set System Time using SetSystemTime API

使用SetSystemTime API设置系统时间

Set double click time of mouse using SetDoubleClickTime API

使用SetDoubleClickTime API,设置鼠标的双击间隔速度

Get double click time of mouse using GetDoubleClickTime API

使用GetDoubleClickTime API,得到鼠标的双击间隔速度

Delete a File using DeleteFile API

使用DeleteFile API,删除文件

Get Volume Information of disk drive using GetVolumeInformation API

使用GetVolumeInformation API得到磁盘驱动器的卷标信息

To check whether particular drive is present or not using GetLogicalDrives API

使用GetLogicalDrives API检查驱动器

Get the amount of physical and virtual memory free,used using GlobalMemoryStatus API

使用GlobalMemoryStatus API得到空闲物理和虚拟内存数。

Get current resolution,number of colors and bits/pixels using GetDeviceCaps API

使用GetDeviceCaps API得到当前分辨率,颜色数,和象素。

Check whether sound card is installed or not using waveOutGetNumDevs API

使用waveOutGetNumDevs API,检查声卡是否安装

Check whether network is installed or not using GetSystemMetrics API

使用GetSystemMetrics API,检查网络是否安装

Check whether mouse is installed or not using GetSystemMetrics API

使用GetSystemMetrics API,检查鼠标是否安装

Get default Icon Width using GetSystemMetrics API

使用GetSystemMetrics API得到缺省图标的宽度

Get current resolution using GetSystemMetrics API

使用GetSystemMetrics API,得到当前的分辨率。

Check how your windows booted using GetSystemMetrics API

使用GetSystemMetrics API,检查你的windows启动模式

Returns the height and width in pixels of a string based on the current font characteristics

用象素单位返回当前特征字串的高和宽。

Extract,Draw and Destroy Icon using ExtractIcon,DrawIcon and DestroyIcon API

使用ExtractIcon,DrawIcon 和 DestroyIcon API提取,画和销毁图标。

Get details about your OS using GetVersionEx API

使用GetVersionEx API得到你的操作系统的详细信息

Writing a string data into WIN.INI using WriteProfileString API

使用WriteProfileString API写字符数据到win.ini

Get a string data from WIN.INI using GetProfileString API

使用GetProfileString API从win.ini得到字符数据

Get a integer data from WIN.INI using GetProfileInt API

使用GetProfileInt API从win.ini,得到一个整型数据

Write a string data to an INI file using WritePrivateProfileString API

使用WritePrivateProfileString API写一个字符数据到一个ini文件

Write a section of data to an INI file using WritePrivateProfileSection API

使用WritePrivateProfileSection API写部分数据到一个ini文件

Get an integer data from an INI file using GetPrivateProfileInt API

使用GetPrivateProfileInt API从INI文件得到整型数据

Get a string data from an INI file using GetPrivateProfileString API

使用GetPrivateProfileString API从ini文件得到字符数据

Get the length of a string using

得到使用的字符串的长度

Copy a string to another variable using lstrcpy API

使用lstrcpy API拷贝字串到别的类型变量

Copy n-1 number of characters from source string to the target string using lstrcpyn API

使用lstrcpyn API从源字串copy n-1特征字符数到目标字串。

Display Shutdown dialog screen using ExitWindowsDialog API

使用ExitWindowsDialog API显示关闭屏障对话框

Display shutdown dialog screen using SHShutDownDialog API

使用SHShutDownDialog API显示关闭屏障对话框。

Display the restart or shutdown dialog using RestartDialog API

使用RestartDialog API显示重启或关闭对话框

Display shutdown or restart dialog using SHRestartSystemMB API

使用SHRestartSystemMB API显示关闭或重启对话框

Display the run dialog using SHRunDialog API

使用SHRunDialog API显示运行对话框

Display Format drive dialog using SHFormatDrive API

使用SHFormatDrive API,显示格式化对话框

Display change icon dialog using SHChangeIconDialog API

使用SHChangeIconDialog API,显示改变图标对话框

Display pick icon dialog using PickIconDlg API

使用PickIconDlg API显示挑选图标对话框

Get Shell Folders locations using SHGetSpecialFolderLocation API

使用SHGetSpecialFolderLocation API得到Shell文件夹位置

Flash a window using FlashWindow API

使用FlashWindow API,闪动窗口

Get classname for some controls using GetClassName API

使用GetClassName API得到一些控件的类名

Get Current Process and Current ProcessID using GetCurrentProcess and GetCurrentProcessId API

使用GetCurrentProcess and GetCurrentProcessId API得到当前Process和ProcessID。

Get Current Thread and Current Thread ID using GetCurrentThread and GetCurrentThreadId API

使用GetCurrentThread and GetCurrentThreadId API得到当前Thread和Thread ID

Get Cursor Position using GetCursorPos API

使用GetCursorPos API得到鼠标位置。

Get foreground window using GetForegroundWindow API. Very useful to develop security programs and system logger programs

使用GetForegroundWindow API得到最前的窗口,对于开发安全程序和系统程序很有用

Find a window knowing it's caption using FindWindow API

使用FindWindow API,查找窗口并获知它的标提

Get Background color of a device context using GetBkColor API

使用GetBkColor API得到设备上下文使用的背景颜色

Get the caption of control which captures mouse event using GetCapture API

使用GetCapture API捕获鼠标事件。得到控件标题

Get system colors using GetSysColor API

使用GetSysColor API得到系统颜色

Set system colors using SetSysColors API

使用SetSysColors API设置系统颜色

Create a Elliptic Form using CreateEllipticRgn and SetWindowRgn API

使用CreateEllipticRgn and SetWindowRgn API创建椭圆形窗体

Create a Rectangular Form using CreateRectRgn and SetWindowRgn API

使用CreateRectRgn and SetWindowRgn API创建矩形窗体

Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API

使用CreateRoundRectRgn and SetWindowRgn API,创建圆矩形窗体

Get File information by it's Handle using GetFileInformationByHandle API

使用GetFileInformationByHandle API通过它的句柄,得到文件信息

Get filetime using GetFileTime API

使用GetFileTime API得到文件时间

Set filetime using SetFileTime API

使用SetFileTime API设置文件时间

Set the File modified time to Current System Time using GetSystemTimeAsFileTime API

使用 GetSystemTimeAsFileTime API设置文件修改时间到当前系统时间

Get window position points using GetWindowRect API

使用GetWindowRect API得到窗口位置

Get Foreground Window Thread and Process ID using GetWindowThreadProcessId API

<TR

Published At
Categories with Web编程
Tagged with
comments powered by Disqus