|
|
Undocumented Shell Path APIs (Extracting Component Parts).
|
Total Hit (4710) |
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
|
|
|
How to retrive and delete all internet cache entries?
|
Total Hit (4934) |
In this article I will show you the use of FindFirstUrlCacheEntry, FindNextUrlCacheEntry, FindCloseUrlCache and DeleteUrlCacheEntry APIs. First three APIs are used to retrive cache entries and DeleteUrlCacheEntry is used to delete a specific entry from the cache.
Here is the example
«b»Step-By
....Read More |
Rating
|
|
|
Dynamically Add Controls to a Form with Visual Basic 6.0
|
Total Hit (29710) |
Visual Basic 6.0 allows you to dynamically add control to a form at run- time using the new Add method of the Controls collection. This article shows how to dynamically add intrinsic and ActiveX controls.
«pre»«b»Control«/b» «b»ProgID«/b»
==========================================
CheckB
....Read More |
Rating
|
|
|
How To Print Using Custom Page Sizes on Windows NT and Windows 2000
|
Total Hit (6751) |
Have you ever tried to set custom paper size using VB inbuilt Printer object ??? You can set custom papersize by setting Printer.PaperSize = 256 and then Printer.Height = 4500 , Printer.Width = 7500 but unfortunately this wont work under NT/2000 because in NT each paper size is considered as a "Form
....Read More |
Rating
|
|
|
|
|
|
ExplodeForm - Show a form with an explode effect
|
Total Hit (1904) |
«Code LangId=1»
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
' Show a form with an explosion effect.
' the lNumSteps parameter is the number of steps to increase the form size from
' 0 to the original size
' the lStepDuration argument is the number of milliseconds
....Read More |
Rating
|
|
|
LongPathName - Convert a 8.3 file name to long format
|
Total Hit (2220) |
«Code LangId=1»Private Declare Function GetLongPathName Lib "kernel32" Alias _
"GetLongPathNameA" (ByVal lpszShortPath As String, _
ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long
Const MAX_PATH = 260
' Convert a short file/path name to a long name
' the file or path
....Read More |
Rating
|
|
|
IsValidPhoneField - Check whether a phone number is valid
|
Total Hit (1715) |
«Code LangId=1»' Validate attributes of Phone data
' Returns True if valid, False if invalid
'
' Also returns the phone in formatted fashion (USA format).
' Will convert alphabetics to numeric
'
'Example:
' If IsValidPhoneField(Value:="3034414444", ReformattedPhone:=strNewPhone,
' '
....Read More |
Rating
|
|
|
CComplexNumber - A class for dealing with complex numbers
|
Total Hit (2767) |
«Code LangId=1»Option Explicit
'------------------------------------------
' A class for dealing with complex numbers
'------------------------------------------
' The main properties
Public Real As Double
Public Imaginary As Double
' Initialize this complex number
' (returns Me)
Fu
....Read More |
Rating
|
|
|
Setting the off-line mode
|
Total Hit (3891) |
You can programmatically set the Internet Explorer off-line mode with the InternetSetOption API, as this code snippet demonstrates:
«Code LangId=1»
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_CONNECTED = 1
Const INTERNET_STATE_DISCONNECTED = 2
Const INTERNET_STATE_DISCONNE
....Read More |
Rating
|
|
|
Open and close the CD drive's door
|
Total Hit (3225) |
Here's a short code snippet that lets you programmatically open and close the CD door. Note that not all the CD drives support these functions:
«Code LangId=1»
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnStr
....Read More |
Rating
|
|
|
Detect when a new control is added to an ActiveX container
|
Total Hit (2740) |
You can easily create ActiveX controls that work as containers for other controls, by setting their ControlContainer property to True. However, VB doesn't offer any event for detecting when the programmer adds or remove controls to the ActiveX control, after placing it on a form's surface.
It's p
....Read More |
Rating
|
|
|
Print the WebBrowser's contents
|
Total Hit (3071) |
The WebBrowser control doesn't expose any method to directly print its contents. You can achieve this effect through the ExecWB method, by passing the OLECMDID_PRINT constant in its first argument:
«Code LangId=1»
' display the Print dialog
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMP
....Read More |
Rating
|
|
|
The behavior of the LostFocus event depends on VB version
|
Total Hit (1751) |
The behavior of the LostFocus event has changed in the transition from VB4 to VB5. Under VB4, if a control on a form has the input focus and the user clicks on a toolbar button, the control fires a LostFocus event. Under VB5 and VB6, the same action doesn't fire any LostFocus event, so you must awar
....Read More |
Rating
|
|
|
Missing Option Explicit directives
|
Total Hit (3363) |
The single statement that is most useful to avoid bugs is Option Explicit. Always use it in every module of your applications. Even better, let the Visual Basic IDE automatically add one whenever you create a new module to your project. You can do it by selecting the "Require Variable Declarations"
....Read More |
Rating
|
|
|
How to handle the Mouse Wheel events in your projects (improved)
|
Total Hit (3183) |
API Declarations
«Code LangId=1»
'==============inside a MODULE
Option Explicit
'************************************************************
'API
'************************************************************
Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA"
....Read More |
Rating
|
|
|
How to Obtain the name of the computer...
|
Total Hit (3142) |
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
|
|
|
|
Using the ListView Checkbox
|
Total Hit (1246) |
By popular demand, here are several methods you can employ to perform a variety of ListView check box-related operations.
Setcheck: turns on the checkbox for the item passed as the value in the textbox.
GetChecked: displays a MsgBox with a list of currently-selected checked items and their List
....Read More |
Rating
|
|
|
Creating a Common Control Header via the API
|
Total Hit (969) |
If you're like myself, you've probably wished that some of Visual Basic's other controls provided the look (and functionality) of a ListView's header. In this example, we'll use the API to create a real header control and position it overtop a list or textbox.
....Read More |
Rating
|
|
|
Enumerating the Installed and Supported System Locales
|
Total Hit (1690) |
In addition to locale information pertaining to the current system setting, the EnumSystemLocales API provides the means to enumerate via callbacks all supported or installed national language support for a given system. Armed with the country LCID's returned by the call, an application can retrieve
....Read More |
Rating
|
|
|
Storing Objects Against ItemData and Tag properties
|
Total Hit (1940) |
ListBox and Combo boxes have an ItemData property to allow you to store an additional long value against each ListItem. Similarly, ListView items and TreeView nodes have a Tag property which can be used to store a string. But what if you want to associate more data along with an item? Clearly you ca
....Read More |
Rating
|
|
|
Slow Grow
|
Total Hit (1715) |
This sample models diffusion-limited aggregation and demonstrates that random behaviours can lead to rather less random-looking results with hardly any constraints on the random behaviour.
|
Rating
|
|
|
Office/VS.NET Style Flat Combo Boxes
|
Total Hit (1730) |
This project provides a class which subclasses Combo Boxes and other controls so that they draw in a flat style and highlight when the mouse is over or they are in focus. The class works on all types of Combo and ComboBoxEx controls as well as on TextBoxes and PictureBoxes. By default, the Office 10
....Read More |
Rating
|
|
|
vbAccelerator Scroll Buttons Control
|
Total Hit (1348) |
This control provides an implementation of an API scroll bar control which can be extended to display completely configurable buttons at either end of the scroll bar. This way you can add extra functionality like the VB code editor's Procedure/Full Module view buttons or zoom in and out buttons like
....Read More |
Rating
|
|
|
Window Shapes Using Layering
|
Total Hit (2492) |
This article provides an alternative, higher-performance way of creating a custom-shaped Windows region from a bitmap for Windows 2000 and XP systems. Prior to Windows 2000, window shapes could only be customised using the SetWindowsRgn API. In Windows 2000 and above support the Layered Windows APIs
....Read More |
Rating
|
|
|
Text At Any Angle
|
Total Hit (2442) |
VB doesn't provide you with any method to change the angle text is written out at on a Form or PictureBox. This seems to be a curious oversight of the OLE StdFont object, because it is in fact very simple to create a font with angles other than horizontal. This article shows you how to do it. The so
....Read More |
Rating
|
|