Category Archives: Visual Basic 6 (VB6)

fGetSystemInfo

MS stipulates that OS Version Info must be obtained “correctly” in their Windows2000 Application Specifications. This is the way.It also uses api’s to get the OS path, get the Windows Temp Dir and to generate a unique temp file name.This is a .BAS file with a Sub Main() so it should compile easily. It generates the info, writes… Read More »

HTTPSafeString

Makes a string http querystring friendly by replacing all non-alpha and non-numeric characters with the appropriate hex code. Helpful when using the wininet API.example: “(Find This)” becomes “%28Find%20This%29” Original Author: Greg Tyndall Inputs Text as String Returns String Code Public Function HTTPSafeString(Text As String) As String  Dim lCounter As Long  Dim sBuffer As String  Dim sReturn As String    sReturn = Text    For lCounter =… Read More »

fWait

Shells an app, then waits for that app to close before it continues processing. Original Author: Brian Cidern Inputs None — Assumptions Pseudo code:Uses API to get the OS dir (for 95/98/NT4/2000 compatability) and appends result with Notepad.exe. Shells Notepad, returning process id. fWait gets the app hdl and issues a Do Events until the exit code of the… Read More »

Game Editor/Hex input-output

This is a big update from the other editor I posted here. This inlcudes: A status Bar, which holds the tooltiptext, A Tab Strip, and updated use of the CommonDialog Control. In this code, you will find out how to convert an ASCII (from a file) string to Hex and then Decimal. Then convert the decimal back to… Read More »

Select List Box or Combo Box Value by Index

This function will select the value of a List Box or Combo Box based upon the Index ID. This is helpful when you are trying to edit a record and want to select a saved value in a combo box or list box. Original Author: Cierra Computers & Consulting API Declarations Public Enum CtlTypeListBoxComboBoxEnd Enum Code Public Sub SelectInList(varID… Read More »

Add Users to Distribution List in MS Outlook

Purpose:”Several Visual Basic based functions that demonstrate how to create and administer Distribution Lists (DL) using Collaboration Data Objects (CDO).” This code was taken from Microsoft (Article ID: Q178787) and I made it into a class so all you need to do is plug in your info and your ready to. I have included the article in the… Read More »

AutoComplete Combo

Access-like AutoComplete of a dropdown combobox or a simple combo box based on what’s already in the list. Simple code but can handle backspace and delete and will finish the ‘complete’ on Enter keystroke or lost focus. Could easily be converted to a user control. Original Author: Dan Redding – Blue Knot Software Attachments File Uploaded Size CODE_UPLOAD34122152000.zip 9/3/2020… Read More »

Beginner Form On Top

Puts Your form on top. Original Author: Demian Net API Declarations ‘Put this in a modulePublic Sub FormOnTop(FormName As Form)Call SetWindowPos(FormName.hwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, FLAGS)End SubPublic Sub FormNotOnTop(FormName As Form)Call SetWindowPos(FormName.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, FLAGS)End Sub Code ‘To make your form on top:FormOnTop Form1’To take you off off of on top:FormNotOnTop Form1

Transaction Committ/Rollback

This code allows for multiple record updates to be grouped into a single batch style transaction. You can then either committ changes to multiple records, or rollback the changes in the case of errors or conditions not being meet. This code is ideal for month-end processing, or in a situation where there is the possibility of errors being… Read More »