Advertisement

Results for "Author: kamilche"

2_2002-2004 #121561
Stop Scrollbar from Blinking

Stop the infernal blinking of the scrollbar in VB6.

2_2002-2004 #121572
Drag form without titlebar

Drag a form that has no titlebar! Add the routine listed below, and call it in the 'MouseDown' event of the form (or a control on the form): MoveWindow Me.Hwnd

2_2002-2004 #121647
List All Files in Folder plus Subfolders (Simple, One Function)

Given a pathname, this function will return a string containing a list of all files in that folder plus subfolders. Much easier than other examples posted here! A single recursive function, with no API's or special types needed.

2_2002-2004 #122122
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 combines all of the above.

2_2002-2004 #122768
Add Colored Text to RichTextbox

Adds the text to a textbox, checking for length overflow. First, it checks, and if the textbox exceeds 15,000 characters, it strips out all but the last 2000 characters to make room for the new text. It doesn't break in the middle of lines - it only deletes 'whole lines.' Then it adds the text to the end, using the color you specified (if any), and scrolls to the end of the textbox. I use it all the time, got tired of cutting/pasting out of old projects, thought I'd put it here on PSC.

2_2002-2004 #125065
DirectX Room Example (Retained Mode)

Displays a 3D room with textures and lights, and lets the user move around in it. Uses DirectX Retained Mode.

2_2002-2004 #125896
Simple Slider

A simple slider control with no tickmarks, that looks attractive at small sizes (no appearance bug like exists in VB6's control). In addition, clicking on the slider bar jumps the thumb directly to that point - there's no need to 'page up' and 'page down' continuously to get there.

2_2002-2004 #125960
Inheritance Without Containment

This example illustrates how to set up inheritance in VB, without using containment ('has-a') processing. The data structure is very flexible, as each class and object instance is basically a hash table (a dictionary in VB). It usess 'CallByName' to call the appropriate routine based on type, at runtime. Note that this could be made much more efficient and speedy by using a custom hash table class and enums instead of strings for properties, but I left that out to simplify this example.

2_2002-2004 #126197
Graphic Blitting Engine (Basic)

BlitEngine is a 'mini graphic engine' suitable for games. It uses no DirectX - these are pure GDI API calls. It illustrates several concepts, including transparent blitting, 'dirty rectangle' processing, double buffering, multiple on-screen sprites on the screen, loading pictures into memory bitmaps instead of picture boxes, 8-bit vs. 24-bit color, 'inverse masks' which enable transparency, tracking frames per second, animating graphics on the screen, implementing a 'demo' mode, and more. With this app, I get 42 frames per second on a 233 mhz Pentium and 140 frames per second on a 350 mhz Compaq. What speed do YOU get, on what machine?

2_2002-2004 #126757
Perpetucal

A Javascript perpetual calendar optimized for printing. It handles holidays, birthdays, and events with timing like 'The fourth Thursday in November' (Thanksgiving) and 'The last Monday in May' (Memorial day).

3_2004-2005 #131372
Simple ADO DataCombo Example

Explains how to hook a 'lookup' combobox to a data field at runtime. Doesn't use the ADO control - uses pure recordset manipulation. Illustrates what the differences are between 'DataSource' 'RowSource', 'BoundColumn', 'DataField', and 'ListField'. M$ documentation is truly bad at explaining this topic.

3_2004-2005 #132289
AVI, MP3, WMA, Ogg, Midi, and more player!

This program allows you to play audio and video files in various formats, including MP3, Ogg, WAV, WMA, AVI, and more. It uses DirectShow, and doesn't require any DLL's or custom OCX's.

3_2004-2005 #132373
Container Speed Testing - Hash, Array, Direct, List, Dictionary, Collection, Recordset

There's many different ways to store data in VB. This application tests a few of them. You shouldn't blindly choose the method that has the highest numbers! You should choose a method based on the usage pattern of your data. For instance, even though the timings say 'clsDirect' is fastest, for my application, a combination of clsHash and clsList proved to work 50% faster. If you don't know which method is best, try them all - they all implement interface IContainer, and swapping out one for another is a simple one-line code change.

3_2004-2005 #134470
EZMailer, an SMTP/POP3 email program

Are you tired of Outlook and Outlook Express hanging your machine, and letting the KAK virus in? Well, I am too, so in response, I made EZMailer, a simple email program that sends and receives mail, PERIOD. It doesn't attempt to interpret or auto-execute ANYthing, thus sparing you from the vagaries of security loopholes in 'advanced' mail programs. This program receives incoming mail from a POP3 server, sends outgoing mail through an SMTP server, handles MIME attachments, multiple users, and automatically routes incoming mail to folders based on criteria you specify. Note that to successfully execute this code in the runtime environment, you must own Apex Software's TrueDBGrid Pro, www.apexsc.com; and Funduc's Encode/Decode DLL, www.funduc.com

3_2004-2005 #134917
Choose Directory

Via API calls, has the user choose a directory. No commondialog needed!

3_2004-2005 #135314
Add Error Handling

This is the complete code for a VB IDE addin that will add error handling to your procedure. Requires that you have a routine called "HandleError" in a public module accessible to all routines. Sample HandleError routine follows: Public Sub HandleError(ByVal CurrentModule As String, ByVal CurrentProcedure As String, _ ByVal ErrNum As Long, ByVal ErrDescription As String) On Error GoTo Err_Init MsgBox CurrentModule & " " & CurrentProcedure & ": " & ErrNum & " - " & ErrDescription Exit Sub Err_Init: MsgBox CurrentModule & " HandleError: " & Err.Number & " - " & Err.Description End Sub The best VB code handles errors in every routine - this makes the program very robust. However, there's no easy way to determine WHICH routine failed once you're inside of your global error handler 'HandleError'. Therefore, you must pass the routine name to the global error. This can be very tedious! :-O This addin adds an 'On Error Goto Err_Init' to the beginning of the routine, and an 'exit function', 'exit sub', or 'exit property' statement plus the error handling code at the bottom. To add error handling to a routine, place the cursor anywhere in the routine code, and choose 'Add Error Handling' from the 'Add-Ins' menu. The code this routine adds, looks like this: Exit (sub, function, or property here) Err_Init: HandleError CurrentModule, "(your routine name here)", Err.Number, Err.Description Note that it will automatically determine which sort of 'exit' statement is necessary, and what the name of the current procedure is, and pass the procedure name to the error handler.

3_2004-2005 #135348
Sparks - or how to create fireworks over a background picture.

Inspired by the 'Sparks' example entered by Itay Sagui, this demo shows how to display sparks flying out of your mouse, against a background picture, with a programmer-defined color.

3_2004-2005 #135764
Countdown Timer

Displays the number of days, hours, minutes, and seconds till a specified date. Allows you to enter multiple dates. Illustrates how to use the new ListView control in VB6, saving and retrieving from the registry, and the datediff function.

3_2004-2005 #136332
Comment Manual

Prints out a 'table of contents' for your Visual Basic program, which contains method names, syntax, and comments only. Useful as 'cover sheets' for the actual code printout.

3_2004-2005 #136826
INCLUDE Preprocessor and Compiler

Inserts text files at desired spots in the code before compiling. Doesn't modify original source!

Languages
Top Categories
Global Discovery