Library code snippets tagged with visual basic
-
Check if Printer is Installed
by santhoshn
This function will check whether a printer is connected/installed the system
-
Adding real Win32 tooltips for windowless controls
by 10Tec Company
The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. The following trick allows you to create real Windows tooltips for VB intrinsic controls which do not have this property.
-
Add Quick MP3 Audio Functionality to your Programs
by Cooper Sloan - VB6FREAK
Add Quick MP3 Audio Functionality to your Programs - A tutorial on adding MP3 audio, without the use of the Windows Media Component. Uses MCI, so users of the Multimedia Control should have an idea of what to expect.
-
File Searching
by Luke Lesurf
This code will search a folder and all sub folders for a specified file or filter.
-
Get Free Disk Space On Large Drives
by Luke Lesurf
This code will allow you get the free disk space on a drive which is over 2 Gb in size.
-
A better rounding function
by Luke Lesurf
VB's built in round function will round numbers like 12.085 down to 12.08. This is not correct in all cases as this number should be rounded up to 12.09. This round function allows for this.
-
Load M3U playlist
by Marc Pritchard
How to load an M3U playlist for use in a media/music program.
-
Basic media playing class
by Marc Pritchard
Uses the mciSendString API to play media files via the MCI.
-
VB Syntax Highlighter
by Alex
With this code you can highlight VB code. keywords, sub names, and function names are included as well as comments.
-
Create a "Trial" Period
by Alex
This fairly short piece of code allows the program to check whether a trial period of any length has expired, notifying the user how many days are left. The user is given the option to register the program or just not use it any more. It uses the VB registry setting functions. Encryption can be added when saving to the registry so that almost nobody at all can use the program for longer than the trial period.
-
Mouse Reaction Test
by Alex
This program tests your ability to react with the mouse to graphical information displayed on the screen e.g. on a game.
-
MAPI Emailer
by Alex
This code can send simple text emails easily. It uses MAPI controls to send an email.
-
Detect if a particular .exe is running
by Yew Chin Sing
That is some simple code to detect whether a particular .exe is running.
-
Adding multiline balloon tooltips to ListView item
by 10Tec Company
To create tooltip for list-view items, the code checks the item under the mouse pointer in the MouseMove event of the control. It uses for this purpose the LVM_HITTEST message that returns the index of the item at the specified position. The message is sent using the SendMessage API function. The lParam parameter of the function contains the reference to the LVHITTESTINFO structure; you must fill in the pt field of this structure with the coordinates of the mouse pointer before you invoke SendMe
-
Is DLL Registered
by Mike Bender
This source code shows how to check if a Dynamic-Link-Library (DLL) is registered and ready for use on your system via windows API.
-
Compiling and executing Java Code in Visual Basic
by Obaid
If you are familiar with Java programming then you would probably know that one has to code in some text editor and then use Command Prompt to compile and run them by using the same old commands. Now that is indeed very annoying and of course there are many editor which allow you to compile and show the output of your code right there and then. Here I am going to show you how you can do this in Visual Basic. The program will ask for JDK Path and the Path of your code.
-
Registering COM Component Programmatically
by Thushan Fernando
Ever wanted to register a COM Component programatically but didnt quite like shelling to regsvr32.exe? This snippet is your new best friend, it will allow you to register and unregister any COM component:D
-
Send Email Using CDO
by Mike Gagne
This short example illustrates the sending of email using Collaboration Data Objects.
-
Custom Menu Items
by nzjonboy
Ever wanted to have your program in the explorer popup menu? Here's a sample application to help you.
-
Validate email addresses
by Mike J
How to check that a string is a properly formatted email address.