Category Archives: Visual Basic 6 (VB6)

CTray

With CTray you can add/remove/change one icon to the System Tray. All you need to do is add CTray to your project and one picture box to your form, and you’re done! A sample project is included. Original Author: Alexandre Wendt Shima API Declarations Private Declare Function Shell_NotifyIcon Lib “shell32” Alias “Shell_NotifyIconA” (ByVal dwMessage As Long, pNid As NOTIFYICONDATA)… Read More »

Mouse Simulator

This program simulates mouse events. It can, left click, right click, pause between events, and you can easily make it double click too. It works by using an action list (listbox), the user inputs a bunch of actions that they want to perform, then the program does all the actions in the list for a specified amount of… Read More »

Has… String Functions

This is a series of Has.. Codes. It will search a textbox for the following: Lowercase letter, Uppercase letters, Numeric Characters, and Accented Characters. So, if it has lowercase letters or something, it will display a message box. this is a good example of how to use for..next loops, ASCII codes and the Instr Function, then again, this… Read More »

Simple AI Examples from LaMothe’s Book

The book “Tricks of the Game Programming Gurus” by Andre LaMothe, copyright 1994, has an interesting chapter on artifical intelligence. However, all the samples in the chapter are done up in C. I’ve redone them into VB just for the heck of it.There are 5 simple programs illustrating chasing, evasion, patterned movement, random movement, and a program that… Read More »

Freeze a computer!

Ever want to freeze a computer? Well, here is some code to do it. It manipulates the API ‘setparent’ Original Author: Brian Molidor Side Effects Well, Duh. your computer will freeze Code Public Declare Function SetParent Lib “user32” Alias “SetParent” (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Longfunction freeze_computer(frm as form)call SetParent(frm.hwnd, frm.hwnd)end function

Autotype Combo Box

This code was taken from O’Neil. It searches a combo box as the user types. O’Neil’s code was modified to use the SendMessage API to search the combo box, which made it much faster. This is very fast, even with thousands of records in the combo box. Thank you O’Neil for the idea, and the well commented code!… Read More »

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 »

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 »