|
|
Run Length Encodeing Compression example
|
Total Hit (1712) |
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 (1912) |
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 (2753) |
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 (2784) |
«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 (1628) |
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 (1786) |
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 (1531) |
«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 Convert Long File Name to Short File Name...
|
Total Hit (2836) |
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 (3237) |
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
|
|
|
|
|
Create all the sub directories of specified path.
|
Total Hit (2179) |
Sometimes we need to create a directory if it doesn't exist. It is easy to create directories using VB. You can use «b»MkDir«/b» function. But what if we need to create all directories of specified path if none of them exists? Well, if you are running Win2K or higher then its easy. You can use follo
....Read More |
Rating
|
|
|
|
Tutorial on Working with File I/O in VB6
|
Total Hit (3903) |
«b»Reading from a file«/b»
«code LangId=1»Public Function ReadFromFile(FilePath As String) As String
Dim iFile As Integer
Dim s As String
'//Check for File Path
If Dir(FilePath) = "" Then Exit Function
On Error GoTo ErrorHandler:
iFile = FreeFile
Open FilePa
....Read More |
Rating
|
|
|
|
Monitoring folder activities
|
Total Hit (3065) |
In this article I will show you how to use FindFirstChangeNotification, FindNextChangeNotification, FindCloseChangeNotification and WaitForSingleObject API. Unfortunately these all APIs can only give you indication of event but they do not tell you which file/folder has been changed and what event o
....Read More |
Rating
|
|
|
Working with file time APIs
|
Total Hit (9522) |
The date and time functions retrieve and set the date and time for the system and individual files.
There are five time formats. Time-related functions return time in one of these formats. You can also use the time functions to convert between time formats for ease of comparison and display. The
....Read More |
Rating
|
|
|
|
Appending One File to Another File
|
Total Hit (3853) |
The following example demonstrates opening and closing files, reading and writing files, and locking and unlocking files. The application appends one file to the end of another file. The application opens the file having the new data appended with permissions that allow only this application to writ
....Read More |
Rating
|
|
|
|
How To Read/Write Data File Using ReadFile and WriteFile API
|
Total Hit (7577) |
The Win32 API allows binary files to be opened and written using the CreateFile, ReadFile, and WriteFile APIs. These functions offer increased flexibility to write and read from files. This article demonstrates a technique to write large amounts of data, in the form of a large array, to a binary fil
....Read More |
Rating
|
|
|
Undocumented Shell Path APIs (Combining and Constructing Path).
|
Total Hit (3106) |
Way back when Microsoft released Internet Explorer 4.0, they bundled with it a number of upgrades to the operating system including a new DLL called SHLWAPI.DLL (Shell Lightweight Utility APIs). That DLL provided programmers with some useful path manipulation functions (amongst other things), but ob
....Read More |
Rating
|
|
|
Undocumented Shell Path APIs (Extracting Component Parts).
|
Total Hit (4601) |
Way back when Microsoft released Internet Explorer 4.0, they bundled with it a number of upgrades to the operating system including a new DLL called SHLWAPI.DLL (Shell Lightweight Utility APIs). That DLL provided programmers with some useful path manipulation functions (amongst other things), but ob
....Read More |
Rating
|
|
|
Undocumented Shell Path APIs (Testing Path).
|
Total Hit (4212) |
Way back when Microsoft released Internet Explorer 4.0, they bundled with it a number of upgrades to the operating system including a new DLL called SHLWAPI.DLL (Shell Lightweight Utility APIs). That DLL provided programmers with some useful path manipulation functions (amongst other things), but ob
....Read More |
Rating
|
|
|
Compact a Long Path Name to fit a given space
|
Total Hit (1828) |
Often there is not enough room to display all of a long path name. A neat way to format a path name in a given space is to show some of the beginning of the path and the filename itself, whilst missing out some of the central folders and replacing them with ellipses (..) This method is used in many
....Read More |
Rating
|
|
|
Start a document based on its filename
|
Total Hit (1202) |
Starting any document file based on its file name only is very simple in Windows using the ShellExecute function. This tip shows how simple it is - you only really need one declare and one line of code!
|
Rating
|
|
|
Changing File and/or Folder Attributes Recursively
|
Total Hit (1323) |
The basic recursion techniques from Performing Recursive Searches Using FindFirst and SearchTreeForFile are used in this demo, but modified to include code for changing either the file, folders or both beneath the target directory specified. The code returns to the list all files processed, as well
....Read More |
Rating
|
|