|
How to obtain the description of the System's Processor
|
Total Hit (4065) |
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
|
|
|
|
|
|
|
|
|
|
|
SemiCRC - A fast CRC-like algorithm
|
Total Hit (1542) |
«Code LangId=1»
' Evaluate the 16-bit Checksum of an array of bytes
Function SemiCRC(bSource() As Byte) As Long
Dim lngCRC As Long
Dim lngTemp As Long
Dim lngSize As Long
Dim I As Long
Const divisor As Long = 32768
lngSize = UBound(bSource())
For I = 0 T
....Read More |
Rating
|
|
|
|
Check for a valid URL
|
Total Hit (3933) |
Before posting an Internet request you should check that the user has entered a valid Internet address. You can do this with a parsing routine, or use the following routine based on the IE5 library:
«Code LangId=1»
Private Declare Function IsValidURL Lib "urlmon" (ByVal pBC As Long, _
url A
....Read More |
Rating
|
|
|
Delete a folder and all its subfolders
|
Total Hit (3342) |
The RmDir command can delete a directory only if it doesn't contain files or sub-directories. If the directory you want to delete does contain other files or, worse, subdirectories it seems that you are forced to use a recursive routine that does the job.
A simpler solution is offered by the Dele
....Read More |
Rating
|
|
|
Quick Property Edits
|
Total Hit (2158) |
When you are placing controls on a form at design time and wish to edit one of its properties, the quickest way to switch to the Property window is pressing the Ctrl+Shift+key combination, where key is the first letter in the property name. For instance, to quickly modify the Caption property you si
....Read More |
Rating
|
|
|
The age of a person
|
Total Hit (2760) |
You can quickly evaluate the age of a person using the following function:
«Code LangId=1»
Function Age(BirthDate As Date, Optional CurrentDate As Variant) As Integer
If IsMissing(CurrentDate) Then CurrentDate = Now
Age = Year(CurrentDate) - Year(BirthDate)
End Property
«/Code»
If
....Read More |
Rating
|
|
|
Tricks with LCase and UCase
|
Total Hit (2777) |
There are a few tricks that you can do with LCase$ and UCase$ functions. I doubt you will be using this tip in all your applications, but here they are for when you'll need them.
Say you wish to check that a string (or a portion of it) does NOT include any alphabetical characters: instead of set
....Read More |
Rating
|
|
|
How to extract various parts of URL using UrlGetPart API ?
|
Total Hit (4931) |
Have you ever tried to extract various parts of URL....? If yes then you know how tedious it is. But in fact is very simple if you use API UrlGetPart.
Here is a simple example to use this API.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Place the following code in form1
....Read More |
Rating
|
|
|
How to renew/release DHCP lease of a selected interface ?
|
Total Hit (5961) |
This article will show you how to use IP Helper APIs GetAdaptersInfo, GetInterfaceInfo, IPReleaseAddress and IPRenewAddress to list all available IPs and perform renew/release operation on a selected IP.
Before we see actual code lets quickly check the description of each API.
«b»GetAdaptersIn
....Read More |
Rating
|
|
|
Printing using GDI printing APIs
|
Total Hit (3651) |
This sample code will show you how to perform basic print operations using GDI print APIs
- Create a standard exe project
- Add one command button control on the form1
- Add the following code in form1
«code LangId=1»Option Explicit
Private Declare Function StartDoc Lib "gdi32" Alias _
....Read More |
Rating
|
|
|
|
Tutorial on Working with File I/O in VB6
|
Total Hit (3932) |
«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
|
|
|
Using the GetOpenFileName Common Dialog API - Overview
|
Total Hit (1459) |
This page details the descriptions of Windows GetOpenFileName and GetSaveFileName API methods. The related demo code pages show how to call the APIs, as well as demonstrating how to retrieve the constituent parts of the file string returned.
To access both of the file common dialogs, the OPENFILEN
....Read More |
Rating
|
|
|
Enumerating Windows Using Callbacks
|
Total Hit (1206) |
Windows offers VB programmers the 'EnumXXX' APIs providing callback data for specific tasks.
This page demonstrates using the EnumWindows() API to enumerate all windows on the system, and populate a listbox with their class name, hwnd and window text if available.
....Read More |
Rating
|
|
|
Make a ComboBox drop down when you press the down arrow key
|
Total Hit (1776) |
Drop-down combo boxes by default drop down when you press the F4 key. However, not many users know this, and you can make a combo box easier to use by making it drop down in response to the down arrow key instead.
|
Rating
|
|
|
AVI Frame Extractor
|
Total Hit (2818) |
The AVI Frame Extractor code provided here allows you to extract and display individual frames from AVIs. This can be useful if you're trying to create a derivative of an existing AVI as you can extract each of the frames and either edit them in a painting package or write a program to do it. There'
....Read More |
Rating
|
|
|
Hierarchy Selector Control
|
Total Hit (965) |
The Hierarchy Selector control is an enhanced COMCTL32.OCX TreeView control which allows you to easily create option dialogs like the Win98 Folder Options dialog and the Internet Explorer Advanced option dialog. In addition to this, it also provides methods which allow you display a hierarchy of opt
....Read More |
Rating
|
|
|
vbAccelerator MDITabs Control
|
Total Hit (2344) |
Over the years, Microsoft applications have been moving away from the old Multiple Document Interface style to a more modern look. This component, provided as a DLL, automatically converts a VB MDI application to one which looks like Visual Studio, with a tab for each window. Tabs can be scrolled an
....Read More |
Rating
|
|
|
S-Grid 2.0 Features
|
Total Hit (2401) |
This article provides a rundown of the new features and updates provided in S-Grid 2.0, and also shows samples of the types of displays that can be set up using the control.
|
Rating
|
|
|
Using The IconMenu Control To Create a Colour Picker
|
Total Hit (852) |
This project demonstrates how to use the new Caption shortcuts in the Icon Menu control to create multiple column menus which don't have separators. By adding the hat character ("^") to the beginning of a menu caption, the Icon Menu control will start a new menu column without a separator line. (Use
....Read More |
Rating
|
|
|
Win32 Hooks in VB - The vbAccelerator Hook Library
|
Total Hit (2538) |
When a subclass isn't tough enough for the job, its time to move to an even lower-level and more disruptive technique. Win32 Hooks are a method by which you can tap into the Windows message stream for every single message directed to every window in your application. You can modify or even discard m
....Read More |
Rating
|
|