|
How to Hide/Show the Windows Task Bar and the Desktop...
|
Total Hit (3047) |
API Declarations
«Code LangId=1» Private Declare Function ShowWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declar
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
IsExecFile - Check whether a file is an executable file
|
Total Hit (1432) |
«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
|
|
|
Cot, Sec, Csc - Missing trig functions
|
Total Hit (3474) |
«Code LangId=1»' Cotangent of an angle
Function Cot(radians As Double) As Double
Cot = 1 / Tan(radians)
End Function
' Secant of an angle
Function Sec(radians As Double) As Double
Sec = 1 / Cos(radians)
End Function
' cosecant of an angle
Function Csc(radians As Double) As
....Read More |
Rating
|
|
|
Display an animated GIF using the WebBrowser control
|
Total Hit (4210) |
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 (4859) |
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
|
|
|
Insert a picture into a RichTextBox control
|
Total Hit (3931) |
Here's a simple method to programmatically insert an image into a RichTextBox control, by copying it into the clipboard and then pasting it into the control:
«Code LangId=1»
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
hwnd As Long, ByVal wMsg As Long, By
....Read More |
Rating
|
|
|
Correctly set scrollbars' width and height
|
Total Hit (3208) |
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
|
|
|
Determine when a TextBox control is scrolled
|
Total Hit (1698) |
When the user scrolls the contents of a TextBox control - either by clicking on the companion scrollbars or by typing new characters in the edit area - the TextBox control sends its parent form a WM_COMMAND message, and passes its own hWnd property in lParam and the value EN_HSCROLL or EN_VSCROLL in
....Read More |
Rating
|
|
|
Copying menu controls from one form to another
|
Total Hit (2671) |
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
|
|
|
GoSub are slower in compiled programs
|
Total Hit (3326) |
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 (5295) |
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
|
|
|
How to convert all accent char to normal char (Only for win2k)?
|
Total Hit (2297) |
This example will show you how to convert all accent characters to normal character.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add the following code in form1
«code LangId=1»Private Declare Function FoldString _
Lib "kernel32" Alias "FoldStringA" ( _
ByVal dwMapFlags
....Read More |
Rating
|
|
|
|
Fill in Word Forms Using Information Stored in Access
|
Total Hit (971) |
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
|
|
|
CD Track Listing Using freedb.org
|
Total Hit (983) |
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
|
|
|
Dealing with Circular References
|
Total Hit (1625) |
VB and COM makes a lot of things easy to do, particularly using and dealing with objects: you just create them and normally they clear themselves up automatically once you're finished with them. However, one side effect of the way COM works is that it is possible to create objects which cannot termi
....Read More |
Rating
|
|
|
Resampling with Alpha
|
Total Hit (1807) |
If you want to change the size of a bitmap, you quickly find that standard techniques such as GDI's StretchBlt aren't particularly good and the result is usually very pixelated. Resampling is a technique which smooths the contribution of each pixel whilst changing the size, and although it takes mor
....Read More |
Rating
|
|
|
ComCtl32.DLL Animation Control Class
|
Total Hit (2452) |
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 (1739) |
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
|
|
|
Flicker Free API Drawing
|
Total Hit (2852) |
VB offers a way to reduce flicker when drawing a control through its AutoRedraw property. When AutoRedraw is set, VB creates an Off-Screen buffer to draw into, and only transfers this to the drawing surface when the Refresh method is called. Whilst this works well (ish), it doesn't help if you need
....Read More |
Rating
|
|