Category Archives: Visual Basic 6 (VB6)

Print Screen (take a picture of the screen!)

Take a picture of the screen Original Author: Brent w. Assumptions Found off the web API Declarations Declare Sub keybd_event Lib “user32” _(ByVal bVk As Byte, ByVal bScan As Byte, _ByVal Flags As Long, ByVal ExtraInfo As Long) Code Sub ScreenToClipboard()Const VK_SNAPSHOT = &H2CCall keybd_event(VK_SNAPSHOT, 1, 0&, 0&)End Sub

mSendEmail

If you have Outlook 98 you can send email using VB! Use this code for the basis of creating mailing programs! Original Author: Ian Ippolito (psc) Inputs vcolEmailAddress–collection of string email addressvstrSubject–email subjectvstrBody–email body (use vbCrLf to create lf) Assumptions Requires outlook 98 installed on your machine. Also, make sure you set a reference in your VB project to… Read More »

FastTextStream

Read large text files faster. Reads lines in text files about 30% faster then the TextStream class. Skips much faster. Original Author: Jonathan Orgel Inputs Multiple functions see documentation in code Assumptions Mail me at FastTextStream@kalonymous.com if you want me to send you a zip file with a demo/test project. This project allows you to compare timings withread, readline,… Read More »

CipherII

A StreamCipher encryption similar to the first ‘Cipher’ but now it can encrypt any text or binary file. Original Author: John Cui Inputs PlainText(the text to be encrypted/decrypted), Secret(the password) Assumptions There is only one function to Encrypt/Decrypt the strings. It is to this point stable that you can encrypt the same string multiple times using different passwords every… Read More »

Associate File Name and Icon

For those of you who want to add a touch of professionalism to your program, now you can create a file type in the Windows Registry database which will associate all files ending with your program’s file extension ( yourfile.xxx) to your program. You also specify an icon for your file type and a description. This example also… Read More »

Dynamically Create Databases (.MDB’s) in code

This code creates a Microsoft Access MDB dynamically. Original Author: Kenny Sendel Assumptions This sample code will create a database in the temp directory with the following fields:fldForeNamefldSurnamefldDOBfldFurtherDetails API Declarations NONE Code ”” PUT THIS BEHIND A COMMAND BUTTON TO TEST”’ DeclarationsDim tdExample      As TableDefDim fldForeName     As FieldDim fldSurname     As FieldDim fldDOB       As FieldDim fldFurtherDetails  As FieldDim dbDatabase     As DatabaseDim sNewDBPathAndName  As… Read More »

Office97 Assistant Plays Games!!!

This code makes the irritating office assistant a fun playmate, he play games of Paper, Scissors, Stone…and his expressions change according to your actions!!!! Original Author: Ed Hockaday Assumptions You will need the ietimer.ocx (from ie4) to get this working, a none timer version can be easily built using this code… API Declarations Code ‘This bit goes in a… Read More »

The Most Simple Credit – Scroller

This code will easily let any user create simple, yet effective credit scroller. This is so effectively easy, that any novice can create it. I created this code because I tried the other source code on this site, and I found it difficult to follow. Original Author: silverx10 Inputs N/A API Declarations Code 1) Create a new project (Standard… Read More »

RegCodes

This class contains two functions which can be helpful in creating an online shareware registration system for your software projects. GenerateKeyCode takes a username, or any other string, and generates a unique human-readable registration code (such as 9397-JQM0LD0YJV from the string: Andy Carrasco). GenerateKeyCode will generate a totally unique registration code over and over again, even for the… Read More »

Distance Calculation

This code shows how to use Visual Basic to calculate great circle distance (distance between 2 points using decimal latitudes and longitudes). Original Author: Corey Behrends Inputs see code Assumptions 1. This code does not figure in differences in altiude2. In order to use this code you must have the latitude and longitude in decmal form. Returns Returns the… Read More »