|
How to Convert Long File Name to Short File Name...
|
Total Hit (2856) |
API Declarations
«Code LangId=1» ' API Declare
Private Declare Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
«/Code»
Module
«Code LangId=1» Public Function ShortName
....Read More |
Rating
|
|
|
Count the number of files in a given directory
|
Total Hit (3253) |
API Declarations
«Code LangId=1» Option Explicit
'API constants
Public Const MAX_PATH = 260
Public Const INVALID_HANDLE_VALUE = -1
Public Const FILE_ATTRIBUTE_DIRECTORY = &H10
'API types
Public Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Public Typ
....Read More |
Rating
|
|
|
|
|
|
How to Paint a ScanBar CODE39 on Printer or PictureBox
|
Total Hit (2803) |
«Code LangId=1»'Put this code at a module.
'Usage: PaintCodeBar39 Printer, Xpos, Ypos, BarsHeight, WidthFactor, Text, HumanRead
' Printer.EndDoc
Public Type C39
char As String * 1
bar(1 To 5) As Boolean
spe(1 To 5) As Boolean ' 5th space for character gap
End Type
Dim CODE39(
....Read More |
Rating
|
|
|
|
|
|
|
|
Print a Text File
|
Total Hit (2414) |
Module
«Code LangId=1» Option Explicit
Public Sub PrintTXTFile(FileName As String)
Dim x As Integer
Dim s As String
x = FreeFile
On Error GoTo HandleError
Open FileName For Input As x
Do While Not EOF(x)
Line Input #x, s
Printer.Print s
L
....Read More |
Rating
|
|
|
Get the List of all the Active Tasks
|
Total Hit (3649) |
API Declarations
«Code LangId=1»
Option Explicit
' API Constants
Const WS_MINIMIZE = &H20000000 ' Style bit 'is minimized'
Const HWND_TOP = 0 ' Move to top of z-order
Const SWP_NOSIZE = &H1 ' Do not re-size window
Const SWP_NOMOVE = &H2 ' Do not reposition window
Const SWP_SHOWWINDOW = &
....Read More |
Rating
|
|
|
Create Controls at RunTime
|
Total Hit (4652) |
API Declarations
«Code LangId=1» 'API Calls
Public Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal n
....Read More |
Rating
|
|
|
How to obtain the description of the System's Processor
|
Total Hit (4083) |
API Declarations
«Code LangId=1» 'API Structures
Public Type SYSTEM_INFO
wProcessorArchitecture As Integer
wReserved As Integer
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOfP
....Read More |
Rating
|
|
|
How to Disable the Ctrl-Alt-Del keys combination...
|
Total Hit (3203) |
API Declarations
«Code LangId=1»
Private Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
«/Code»
Module
«Code LangId=1»
Sub DisableCtrlAltDelete(bDis
....Read More |
Rating
|
|
|
How to Hide/Show the Windows Task Bar and the Desktop...
|
Total Hit (3052) |
API Declarations
«Code LangId=1» Private Declare Function ShowWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declar
....Read More |
Rating
|
|
|
...and how to change the name of your computer...
|
Total Hit (2865) |
API Declarations
«Code LangId=1» Private Declare Function SetComputerName Lib "kernel32.dll" Alias "SetComputerNameA" (ByVal lpComputerName As String) As Long
«/Code»
Module «Code LangId=1»
Public Function SetComputerName(Name as String) as Boolean
Dim res As Long
res=SetCo
....Read More |
Rating
|
|
|
How to Obtain the name of the computer...
|
Total Hit (3041) |
API Declarations
«Code LangId=1» Private Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
«/Code»
Module
«Code LangId=1»
Public Function ComputerName() As String
Dim cn As String
Dim ls As Long
Di
....Read More |
Rating
|
|
|
Running an EXE at a particular position with particular dimensions.
|
Total Hit (3357) |
This sample code will show you how to control a shelled application using API.
I have used several tricks in this sample code. Once you know these tricks, you can also use them in your programs. This code will open «b»Notepad«/b» at a specified position with specified window size. You will also
....Read More |
Rating
|
|
|
Run Length Encodeing Compression example
|
Total Hit (1723) |
Module
«Code LangId=1»
' Start a new project and add two command buttons to the form and aslo a text box
' Now place the follwing code below in to the general declarations selecion of the
' form and press 5F. Press the Commpress button and see what has happend to the
' string and then press
....Read More |
Rating
|
|
|
How to Open and Close CD gate
|
Total Hit (1927) |
API Declarations
«Code LangId=1»
Option Explicit
'Declare
Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long
«/Code»
M
....Read More |
Rating
|
|
|
Determines the file version number of an executable file
|
Total Hit (2782) |
API Declarations
Option Explicit
'Declarations:
Private Declare Function GetLocaleInfoA Lib "kernel32.dll" (ByVal lLCID As Long, ByVal lLCTYPE As Long, ByVal strLCData As String, ByVal lDataLen As Long) As Long
Private Declare Sub lstrcpyn Lib "kernel32.dll" (ByVal strDest As String, ByVa
....Read More |
Rating
|
|
|
Another check if a file exists
|
Total Hit (2814) |
«Code LangId=1»Function FileExists(strFile As String) As Integer
'********************************************************************************
'* Name : FileExists
'* Date : Feb-17, 2000
'* Author : David Costelloe
'* Returns : -1 = Does not exists 0 = Exists with zero bytes 1 = Exists > 0
....Read More |
Rating
|
|
|
How to Obtain the Serial Number of a Drive...
|
Total Hit (1640) |
API Declarations
«Code LangId=1»
'API Declarations
Private Declare Function GetVolumeSerialNumber Lib "kernel32.dll" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponent
....Read More |
Rating
|
|
|
How to Calculate the Amount of Free Disk Space Available...
|
Total Hit (1800) |
API Declarations
«Code LangId=1»
'API Declarations
Private Declare Function GetDiskFreeSpace Lib "kernel32.dll" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As L
....Read More |
Rating
|
|
|
|
Functions to find if file exists...
|
Total Hit (1543) |
«Code LangId=1»Public Function FileExists(filename As String) As Boolean
FileExists = (Dir(filename, vbNormal Or vbReadOnly Or vbHidden Or vbSystem Or vbArchive) <> "")
End Function
«/Code»
Usage
«Code LangId=1» 'Usage:
Private Sub Command1_Click()
If FileExists("C:\Config.sys"
....Read More |
Rating
|
|
|
How to detect system activity for mouse and keyboard
|
Total Hit (2615) |
«Code LangId=1»Option Explicit
'===========================================================
'TYPE
'===========================================================
Private Type POINTAPI
x As Integer
y As Integer
End Type
'===========================================================
'API
'=====
....Read More |
Rating
|
|
|
How to Subclass a Form
|
Total Hit (3653) |
«Code LangId=1»'==============inside a MODULE
Option Explicit
'************************************************************
'API
'************************************************************
Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA" ( _
ByVal lpPrev
....Read More |
Rating
|
|