|
|
|
|
|
|
|
IsExecFile - Check whether a file is an executable file
|
Total Hit (1483) |
«Code LangId=1»'check whether the specified file is an executable,
' by checking the last 4 characters.
'Example: MsgBox "File is exe: " & IsExecFile("C:\windows\notepad.exe")
Function IsExecFile(ByVal sFileName As String) As Boolean
Dim sExt As String
On Error Resume Next
....Read More |
Rating
|
|
|
ArrayAny - Return an initialized array of any type
|
Total Hit (2116) |
«Code LangId=1»
' Returns an array and initializes it with passed data.
'
' It is similar to the Array function, but it works with
' array of any type. The type of the returned array is
' assumed to be the type of the first element in the
' parameter list, so you might need to force a given
....Read More |
Rating
|
|
|
Don't store object variables in the SPM
|
Total Hit (2685) |
Some MTS/COM+ newbies wonder whether it is legal to store object variables in the SPM.
No, you can't!! the SPM is unaware of Apartment marshaling issues. If you ask the SPM for an interface pointer while running in an apartment that is different from the one where the interface pointer resides t
....Read More |
Rating
|
|
|
Out-of-date dependency file for COMCTL32.OCX
|
Total Hit (2165) |
Have you ever read a message like "Dependency file for COMCTL32.OCX is out of date" during the package creation process? The cause of this problem is simple: you have installed an application that has replaced your COMCTL32.OCX ActiveX with the newer release (which is 5.00.3828 at this time). The Ac
....Read More |
Rating
|
|
|
Display an animated GIF using the WebBrowser control
|
Total Hit (4371) |
The standard PictureBox control doesn't support the Animated GIF graphic format. However, you can display these images by using a WebBrowser control:
«Code LangId=1»
WebBrowser1.Navigate "c:\Images\Animated.Gif"
«/Code»
The only problem of this technique is that the WebBrowser control also di
....Read More |
Rating
|
|
|
Programmatically register an ActiveX control or DLL
|
Total Hit (4975) |
All ActiveX DLL or OCX export two functions: DllRegisterServer and DllUnregisterServer. They are used to register and unregister the ActiveX in the Windows registry, and are usually invoked from regsvr32.exe at registration time.
However, you can register and unregister these files programmatical
....Read More |
Rating
|
|
|
Correctly set scrollbars' width and height
|
Total Hit (3303) |
You should always modify a vertical scrollbar's width and a horizontal scrollbar's height to conform to the display resolution. You can learn the suggested size (in pixels) using the GetSystemMetrics API function, then convert it to twips, and rezise all the scrollbars on your forms accordingly. The
....Read More |
Rating
|
|
|
Copying menu controls from one form to another
|
Total Hit (2760) |
If you're building a project with multiple similar forms, it's nice to be able to cut-and-paste controls from one form to another. However, in VB6, you can't do this for menu controls - unless you get tricky. The trick is to make an end-run around the VB IDE. Warning: don't try this unless you have
....Read More |
Rating
|
|
|
Start the IDE with maximized code and form windows
|
Total Hit (2280) |
The VB IDE remembers most of the configuration settings that were active when you closed the previous session. However, the maximized status of child MDI windows (the code editor and the designer window) isn't remembered, and the IDE always starts with non-maximized windows. To have VB always start
....Read More |
Rating
|
|
|
GoSub are slower in compiled programs
|
Total Hit (3441) |
In VB applications compiled as native code, GoSubs are 5-6 times slower than calls to regular Subs or Functions; conversely, in p-code they are considerably faster. This is one of the few examples of an optimization rule that is different in p-code from compiled applications.
....Read More |
Rating
|
|
|
|
|
Working with GDI Brush Object
|
Total Hit (5504) |
A brush is a graphics tool that applications use to paint the interior of polygons, ellipses, and paths. Drawing applications use brushes to paint shapes; word processing applications use brushes to paint rules; computer-aided design (CAD) applications use brushes to paint the interiors of cross-sec
....Read More |
Rating
|
|
|
Working with Basic Filled Shapes using GDI API
|
Total Hit (5839) |
Filled shapes are geometric forms that are outlined by using the current pen and filled by using the current brush. There are five filled shapes:
«UL»«LI»Ellipse
«LI»Chord
«LI»Pie
«LI»Polygon
«LI»Rectangle «/UL»
Applications use filled shapes for a variety of tasks. Spreadsheet applicat
....Read More |
Rating
|
|
|
|
How to detect system activity for mouse and keyboard
|
Total Hit (2676) |
«Code LangId=1»Option Explicit
'===========================================================
'TYPE
'===========================================================
Private Type POINTAPI
x As Integer
y As Integer
End Type
'===========================================================
'API
'=====
....Read More |
Rating
|
|
|
|
Fill in Word Forms Using Information Stored in Access
|
Total Hit (1038) |
Although Access reports are flexible and relatively easy to create, they're not always suitable for every task. For example, your company may internally use manual forms that can easily be filled with data from an existing Access database. Your natural reaction is probably to create an Access report
....Read More |
Rating
|
|
|
Connecting to Network Resources
|
Total Hit (1756) |
These are small network routines that provide developers with increased functionality and usability.
The first two routines deal with displaying the Map Drive and Disconnect Mapped Drive dialogs.
The second two deal with printers; the first shows the Windows dialog responsible for setting up a
....Read More |
Rating
|
|
|
Manipulating Image Brightness with SetPixelV
|
Total Hit (1311) |
Here's an interesting bit of code by Tanner Helland that takes any image assigned to a picturebox and rapidly adjusts the image brightness. As the new image is displayed, it progressively wipes overtop the old image (the demo picture shows the progress half-way across the girl). This code could be e
....Read More |
Rating
|
|
|
CD Track Listing Using freedb.org
|
Total Hit (1029) |
This article demonstrates how to use ASPI to read the table of contents from a CD, and then to use FreeDB's CD look-up service to retrieve artist, title and track listing information for the CD. Along the way it describes some of the alternatives and pitfalls.
....Read More |
Rating
|
|
|
ComCtl32.DLL Animation Control Class
|
Total Hit (2522) |
This article presents a simple class you can use to load AVIs from files or an application's resource file for display whilst the application is performing a long operation.
|
Rating
|
|
|
vbAccelerator ListView Control
|
Total Hit (1804) |
This control provides an alternative to the VB ListView control and adds support for almost all of the new ComCtl32.DLL v6.0 features that are missing from the VB version: ListView grouping, Tile view with configurable sub-items, Multiple Work Areas and more.
....Read More |
Rating
|
|
|
vbAccelerator Icon Selector Control
|
Total Hit (2612) |
This control provides a simple to use icon selector, and works in the exactly the same way as the Change Icon dialog in Windows. You can either use it to select existing icons, or you can add your own.
|
Rating
|
|