|
|
|
|
|
|
|
|
SplitSubMenu - Split a submenu with vertical bars
|
Total Hit (2933) |
«Code LangId=1»
Private Type MENUITEMINFO
cbSize As Long
fMask As Long
fType As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type
Private
....Read More |
Rating
|
|
|
GetFileExtension - The extension in a filename
|
Total Hit (2081) |
«Code LangId=1»' Return the extension of a file name
Function GetFileExtension(ByVal FileName As String) As String
Dim i As Long
For i = Len(FileName) To 1 Step -1
Select Case Mid$(FileName, i, 1)
Case "."
GetFileExtension = Mid$(FileName, i + 1)
....Read More |
Rating
|
|
|
|
|
Hide and show the mouse cursor
|
Total Hit (3235) |
At times you may want to temporarily hide the mouse cursor, for example in order to reduce flickering. To do so you just need the ShowCursor API function:
«Code LangId=1»
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
' hide the mouse
ShowCursor False
' do
....Read More |
Rating
|
|
|
Animated form icons
|
Total Hit (4031) |
You can add a professional touch to your apps by showing an animated icon when the main form is minimized. To achieve this effect, prepare an array of Image controls, each one containing the icons that make up the animation, then add a Timer control, with the Enabled property set to True and the Int
....Read More |
Rating
|
|
|
Get the Command$ value from inside an ActiveX DLL
|
Total Hit (3179) |
At times you may need to access the command line passed to the application from within an ActiveX DLL. Unfortunately, when inside a DLL the Command$ function returns a null string, so you have to resort to some API trickery:
«Code LangId=1»
Private Declare Function GetCommandLine Lib "kernel32"
....Read More |
Rating
|
|
|
The first visible line in a multiline TextBox control
|
Total Hit (4042) |
To determine the index of the first visible line in a multiline TextBox control you only need to send it the EM_GETFIRSTVISIBLELINE message:
«Code LangId=1»
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Lon
....Read More |
Rating
|
|
|
Using the CreateDirectory and CreateDirectoryEx API functions
|
Total Hit (6997) |
The VB's MkDir function creates a directory in a specified path. If the directory already exists, MkDir raises error 75 (Path/file access error); yet, it raises the same error code if you attempt to create the directory on a read-only drive. Even worse, in Windows NT/2K/XP workstations, if you try t
....Read More |
Rating
|
|
|
An enhanced VB DatePart function
|
Total Hit (4692) |
Here is an enhanced version of VB DatePart function: the first parameter is now an enumerated type, so easier to use. DatePartEx is 4-5 times faster than DatePart and supports also two new intervals: MonthName and WeekdayName.
|
Rating
|
|
|
Retrieve Time Zone information
|
Total Hit (7157) |
The GetTimeZoneInformation API returns a TIME_ZONE_INFORMATION variable that contains several pieces of information about system's time date and time setting. The first Long value in this structure holds the "distance" (in minutes) from Greenwich standard time, so it's quite easy to create a GetTime
....Read More |
Rating
|
|
|
Create your own Image/Link extractor tool using Regular Expressions
|
Total Hit (3291) |
This is a very simple code to present use of Regular expression to solve some complex text operation which is kinda impossible using inbuilt string functions available in Visual Basic.
For More information Visit the following MSDN article
«a href='http://msdn.microsoft.com/library/en-us/dnclin
....Read More |
Rating
|
|
|
How to perform clipping using API
|
Total Hit (5687) |
To perform very complex clipping operations you can use a set of clipping APIs. From this sample code you will learn several techniques of clipping.
A clipping region is a region with edges that are either straight lines or curves. You can create simple or complex regions using various region API
....Read More |
Rating
|
|
|
|
Monitoring folder activities
|
Total Hit (3202) |
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
|
|
|
|
Browse for Folders Callback Overview
|
Total Hit (1554) |
Windows' Browse for Folders dialog provides the means to retrieve from a user their selection of the Shell's file system and special folders. The following and related code page discuss adding callback functionality to a VB5 application to provide the ability to pre-select a folder on the dialog's d
....Read More |
Rating
|
|
|
Gamma Correction
|
Total Hit (1729) |
A Gamma Correction filter is primarily used for colour matching purposes on CRT based displays, but it can also be used for creative image processing. This article shows how the gamma filter is calculated and provides an implementation.
|
Rating
|
|
|
vbAccelerator Progress Bar Class
|
Total Hit (1866) |
This article provides a class that allows you to draw progress bars onto any control, form or API created object with a hDC property. The drawing code is derived from the vbAccelerator Progress Bar control and all functionality except Image Processing and persistence of data is included.
....Read More |
Rating
|
|
|
vbAccelerator ListBar Control
|
Total Hit (1703) |
The vbAccelerator ListBar control is an all-VB control which emulates the Outlook sidebar as accurately as possible. I was inspired to write it when I started playing with Microsoft's Spy++ utility and pointed it at Outlook's list bar (or "ShortcutBar" as it publicises itself to the world) and notic
....Read More |
Rating
|
|
|
|
CWinInetConnection class
|
Total Hit (2093) |
Check up CWinInetConnection class that, encapsulating the calls of WinInet API, allows you to detect the Internet connection and its properties, establish and hang up the connection, switch the system state known as Online/Offline mode.
|
Rating
|
|
|