Category Archives: Visual Basic 6 (VB6)

How to center a common dialog

Responds to the WM_INITDIALOG message to center the Common Dialog Control on a form. This sample uses a derivative of the technique created for the Windows Styles article in Visual Basic Programmer’s Journal. Uses the following API functions: Attachments File Uploaded Size 899-20170609-062808-CENTRDLG.ZIP 6/9/2017 6:28:08 AM 3467

INI Tutorial

This is a short tutorial piece of code that shows how to work with INI files. It demonstrates how to open and read INI files, as well as create and/or write to INI files.  This allows you to have your program save settings for the next run. Attachments File Uploaded Size 898-20170603-152316-INITutorial.zip 6/3/2017 3:23:16 PM 3068

Compare Two Files in VB6

This is a demo program for usage of the AreTheyTheSame function that was described in the Compare Two Files in VB6 post. Attachments File Uploaded Size 389-20170603-120221-CompareTwoFiles.zip 6/3/2017 12:02:21 PM 2570

Test File Builder

This is just a short program for building test files. The files contain random characters, and are useful for testing things such as transfer speeds, compression ratios, attachment size limits in email, and other things that can use files of varying sizes. For new coders, this small, one-form program demonstrates: Attachments File Uploaded Size 389-20170603-093919-tfb10.zip 6/3/2017 9:39:19 AM… Read More »

Start the screensaver from code in VB6

Nothing magical here. Just using the Windows API to start the screensaver on demand from code in Windows. Let’s say you have a, err, questionable, process running a computer. Hey, I don’t judge. I like a good game of solitaire at work, too. Let us also pretend that your boss is not so keen on having you playing… Read More »

Use VB6 to ping a remote computer

When your application makes connections to remote computers, it is usually a good idea to check to see if the remote machine is up and responding prior to attempting a connection to it. Pinging a machine is one way to do it. Visual Basic 6 doesn’t have a built in method to perform an ICMP echo request (ie,… Read More »

Resolving hostnames and IP Addresses with VB6

Some time ago, I wrote an app that required the ability to resolve hostnames to IP Addresses, and vice versa.  After some searching around, I found this gem. I don’t recall exactly where I found it, but this little chunk of code has served me well, lo these many years.  It contains two functions: The functions do exactly… Read More »