Click the API link to download the example

Arc
BitBlt
CharLower
CharUpper
Chord
CompareFileTime
CopyFile
CopyMemory
CreateDirectory
CreateEllipticRgn
CreatePolygonRgn
CreateRectRgn
CreateRoundRectRgn
DeleteFile
DestroyIcon
DestroyWindow
DrawIcon
EnableWindow
ExitWindowsEx
ExtractIcon
FileTimeToLocalFileTime
FileTimeToSystemTime
FindFirstFile
FindWindow
FindWindowEx
FlashWindow
GetActiveWindow
GetBkColor
GetCapture
GetCaretBlinkTime
GetClassName
GetCommandLine
GetComputerName
GetCurrentDirectory
GetCurrentProcessId
GetCurrentThreadId
GetCursorPos
GetDC
GetDesktopWindow
GetDeviceCaps
GetDoubleClickTime
GetDriveType
GetEnvironmentVariable
GetFileAttributes
GetFileInformationByHandle
GetFileSize
GetFileTime
GetFocus
GetForegroundWindow
GetLocalTime
GetLogicalDrives
GetPrivateProfileInt
GetPrivateProfileString
GetProfileInt
GetProfileString
GetShortPathName
GetSysColor
GetSystemDirectory
GetSystemInfo
GetSystemMetrics
GetSystemTime
GetSystemTimeAsFileTime
GetTempPath
GetTickCount
GetUserName
GetVersionEx
GetVolumeInformation
GetWindowRect
GetWindowsDirectory
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
GlobalMemoryStatus
IsWindowEnabled
keybd_event
LineTo
LoadCursorFromFile
LocalFileTimeToFileTime
lstrcpy
lstrcpyn
lstrlen
mciSendString
MessageBeep
MessageBox
MessageBoxIndirect
mouse_event
MoveFile
MoveFileEx
MoveMemory
MoveWindow
MulDiv
OpenFile
PickIconDlg
Pie
PostMessage
RegCreateKey
RegDeleteKey
RegDeleteValue
RegEnumKey
RegEnumKeyEx
RegEnumValue
RegQueryValueEx
RegSetValueEx
RemoveDirectory
RestartDialog
SendMessage
SetComputerName
SetCurrentDirectory
SetDoubleClickTime
SetEnvironmentVariable
SetFileAttributes
SetFileTime
SetSysColors
SetSystemCursor
SetSystemTime
SetVolumeLabel
SetWindowPos
SetWindowText
SHAddToRecentDocs
SHBrowseForFolder
SHChangeIconDialog
Shell_NotifyIcon
ShellAbout
ShellExecute
ShellExecuteEx
SHEmptyRecycleBin
SHExitWindowsEx
SHFormatDrive
SHGetFileInfo
SHGetSpecialFolderLocation
ShowCursor
ShowWindow
SHRunDialog
Sleep
SwapMouseButton
SystemParametersInfo
SystemTimeToFileTime
WindowFromPoint
WinExec
WNetConnectionDialog
WNetDisconnectDialog
WNetGetUser
WritePrivateProfileSection
WritePrivateProfileString
WriteProfileString
**********************

Convert the letters in a string to all Lower case letters
Private Declare Function CharLower Lib “user32.dll” Alias “CharLowerA” (ByVal lpsz As String) As String
Private Sub Form_Load()
‘ Convert the string “This is a TEST for LOWER Case Convertion!” into lower-case.
Dim t As String  ‘ target string
t = CharLower(“This is a TEST for LOWER Case Convertion!”)  ‘ Convert to lower-case
MsgBox t
End
End Sub

 

Convert the letters in a string to all Upper case letters
Private Declare Function CharUpper Lib “user32.dll” Alias “CharUpperA” (ByVal lpsz As String) As String
Private Sub Form_Load()
‘ Convert the string “This is a test for upper Case Convertion!” into upper-case.
Dim t As String  ‘ target string
t = CharUpper(“This is a test for upper Case Convertion!”)  ‘ Convert to upper-case
MsgBox t
End
End Sub

 

Copy a file
Private Declare Function CopyFile Lib “kernel32.dll” Alias “CopyFileA” (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Sub Form_Load()
Dim retval As Long  ‘ return value
‘ copy the file
retval = CopyFile(“D:\sample.txt”, “D:\example.txt”, 1)  ’1 indicates return value if succeeded
If retval = 0 Then  ‘ failure
MsgBox “Error copying file.”
Else  ‘ success
MsgBox “Copy succeeded.”
End If
End
End Sub

 

Move a file
Private Declare Function MoveFile Lib “kernel32.dll” Alias “MoveFileA” (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
Private Sub Form_Load()
Dim retval As Long  ‘ return value
retval = MoveFile(“D:\showagent.txt”, “D:\showagent1.txt”)
If retval = 0 Then
MsgBox “File not found”
Else
MsgBox “File Move successful”
End If
End
End Sub

 

Display Shutdown dialog screen
Private Declare Sub ExitWindowsDialog Lib “shell32.dll” Alias “#60″ (ByVal hwndOwner As Long)
Private Sub Form_Load()
‘ Shut Down Windows dialog box.
ExitWindowsDialog 0
End
End Sub

 

Display the restart or shutdown dialog
Private Declare Function RestartDialog Lib “shell32.dll” Alias “#59″ (ByVal hwndOwner  As Long, ByVal lpstrReason As String, ByVal uFlags As Long) As Long
Private Sub Form_Load()
‘Restart
retval = RestartDialog(Form1.hWnd, “I warn you that “, 2)
‘Shutdown
‘retval = RestartDialog(Form1.hWnd, “I warn you to Shutdown the system “, 1)
End
End Sub

 

Display shutdown dialog screen
Private Declare Function SHShutDownDialog Lib “shell32″ Alias “#60″ (ByVal YourGuess As Long) As Long
Private Sub Form_Load()
SHShutDownDialog 0
End
End Sub

(more…)