Layered Windows in VB6

Makes a nice layered window effect, with adjustable transparency. Option ExplicitDeclare Function GetWindowLong Lib “user32.dll” Alias “GetWindowLongA” (ByVal hWnd As Long, ByVal nIndex As Long) As LongDeclare Function SetWindowLong Lib “user32.dll” Alias “SetWindowLongA” (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongDeclare Function SetLayeredWindowAttributes Lib “user32.dll” (ByVal hWnd As Long, ByVal crKey As… Read More »

INI File Class

This class module will allow you to easily work with INI files. This will let you store settings and preferences for your program that are persistent between runs. You can download the attachment above, or copy and paste the below chunk of code to a new class module in your project. Option Explicit ‘APIPrivate Declare Function GetPrivateProfileInt Lib… Read More »

Simple Fixed Array, Part 2

In the last tutorial (Simple Fixed Array, Part 1) we had a fixed Array of Elements (Animals), and when we selected one of the Radio Buttons a Label would show us which number the Element was. But what if we had more than just six Elements as in our Array, say we had 500 Elements and we needed… Read More »

Simple Fixed Array, Part 1

When I started programming the one thing that would trick me was Arrays. So, with this in mind, I have decided to write 3 tutorials to try and help other beginners. What follows is a fixed array, an array is simply a container for a list of elemants in the case of this example it is a list… Read More »

Explode or Implode a Form

Rather than have a form simply appear or disappear, you can use this module to add an explode or implode effect when a form appears or disappears. Module Insert the following code to your module. If Win16 Then   Type RECT      Left As Integer      Top As Integer      Right As Integer      Bottom As Integer   End TypeElse   Type RECT      Left As Long      Top As Long      Right As Long      Bottom As Long   End TypeEnd… Read More »

Faded Background with API

This handy little chunk of code will show you how to create a faded background on a form, using the Windows API. Option Explicit ‘ Data type used by FillRectType RECT   Left As Long   Top As Long   Right As Long   Bottom As LongEnd Type ‘ API Functions used to create solid brush and draw brush on formPublic Declare Function CreateSolidBrush Lib “gdi32.dll”… Read More »

Custom ToolTips

Create Custom ToolTips with multiline text and Balloon shape. Option Explicit ‘************************************************************’ Constants’************************************************************ Private Const GWL_WNDPROC = -4Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const FW_NORMAL = 400Private Const FW_HEAVY = 900Private Const FW_SEMIBOLD = 600Private Const FW_BLACK = FW_HEAVYPrivate Const FW_BOLD = 700Private Const FW_DEMIBOLD = FW_SEMIBOLDPrivate Const FW_DONTCARE = 0Private Const FW_EXTRABOLD… Read More »

Capture to Clipboard

This module will allow you to capture the entire screen or just one form, and copy the image to the Windows clipboard. Option Explicit Private Const CCHDEVICENAME = 32Private Const CCHFORMNAME = 32Private Const SRCCOPY = &HCC0020 ‘ (DWORD) destination = source Private Type DEVMODE   dmDeviceName As String * CCHDEVICENAME   dmSpecVersion As Integer   dmDriverVersion As Integer   dmSize As Integer   dmDriverExtra As Integer   dmFields As… Read More »

Tile a Picture on a Form Background

To create a form with tiled picture use the code below. In this code the picture is loaded in a picture box (invisible) and is copied over the form many time as necessary to cover it. So you can use pictures on all formats supported by picture box. Option Explicit Private Type BITMAP   bmType As Long   bmWidth As Long   bmHeight As… Read More »