|
How to Hide/Show the Windows Task Bar and the Desktop...
|
Total Hit (3168) |
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
|
|
|
Floating Point Numbers Validation
|
Total Hit (2085) |
«Code LangId=1»Private Sub Form_Load()
Text1.Text = Empty
End Sub
' USAGE
'Create a form a text box
Private Sub Text1_KeyPress(KeyAscii As Integer)
' Precision is 2 in this case
' Send the Precision Value same in both the Functions
Call ValidateNum(Text1, 2, KeyAscii)
End
....Read More |
Rating
|
|
|
|
|
|
|
|
|
Centering a Window with a Taskbar Visual
|
Total Hit (3224) |
«Code LangId=1»Option Explicit
Private Const SPI_GETWORKAREA = 48
Private Declare Function SystemParametersInfo& Lib "User32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As _
Long, lpvParam As Any, ByVal fuWinIni As Long)
Private Type RECT
Left As Long
Top As Long
....Read More |
Rating
|
|
|
|
|
|
Cot, Sec, Csc - Missing trig functions
|
Total Hit (3726) |
«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
|
|
|
Intercepting MouseEnter and MouseExit events without subclassing
|
Total Hit (4057) |
Visual Basic raises the MouseMove event when the mouse cursor is within a control, so it's easy to know when the cursor "enters" a control. However, determining when the mouse leaves the control is more difficult.
You can solve this problem by monitoring the first time the control raises the Mous
....Read More |
Rating
|
|
|
Open the Internet Connection dialog
|
Total Hit (3798) |
The dialog you see when you start an Internet connection is implemented in the RNAUI.DLL file, and the specific function is called RnaDial. To open this dialog from your application you can call this function through the rundll32.exe application (located in Windows directory) specifying the name of
....Read More |
Rating
|
|
|
|
Cut, copy, and paste using API functions
|
Total Hit (4815) |
Copying and pasting text and images programmatically isn't difficult at all, using the methods of the Clipboard object. However, implementing a generic Edit menu that copies and pastes the highlighted contents of whatever control is the selected control is often cumberson. For example, depending on
....Read More |
Rating
|
|
|
Determine when a TextBox control is scrolled
|
Total Hit (1768) |
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
|
|
|
Beware of slashes when formatting dates
|
Total Hit (2983) |
You probably use the Format function to format date, for example:
«Code LangId=1»
? Format(Now, "mm/dd/yyyy") ' => 08/01/2001
? Format(Now, "mm+dd+yyyy") ' => 08+01+2001
«/Code»
It seems that this is everything you need to know, right? However, the story is quite different
....Read More |
Rating
|
|
|
Sorting on multiple keys
|
Total Hit (2377) |
Frequently you need to sort arrays of records using multiple keys. This may be required since one single key does not uniquely identify a record (e.g. you may need both LastName and FirstName to select a given employee in a large company where people with same name work), or it may be necessary for
....Read More |
Rating
|
|
|
|
How to convert all accent char to normal char (Only for win2k)?
|
Total Hit (2377) |
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
|
|
|
How to monitor Printer Queue using printer API
|
Total Hit (20045) |
This article will show you how you can use OpenPrinter, EnumJobs and ClosePrinter API to monitor selected printer's queue.
To implement Quick Demo perform the following steps
- Create a standard exe project
- Add module1
- Place 1 commandbutton, 1 textbox, 1 combobox 1 timer and 1 ListView
....Read More |
Rating
|
|
|
|
Adding Checkboxes to a Treeview via API
|
Total Hit (1529) |
Recent newsgroup postings have asked how to mimic the Advanced Options page displayed in Internet Explorer 4. Initially I thought of using the listview with checks and indents, but after someone suggested that the items on the page were collapsible, I investigated the treeview styles. Sure enough, a
....Read More |
Rating
|
|
|
Calling the Windows PrintScreen Function Using keybd_event
|
Total Hit (686) |
The following code will copy the contents of the desktop (the screen) into a PictureBox or image control on a form.
Unlike the examples listed at the top of this page, this method uses the Windows API to actually PrintScreen to the clipboard first, and then retrieve that bitmap into the image con
....Read More |
Rating
|
|
|
Tutorial : Sound & Games
|
Total Hit (1784) |
These tutorials are were originally developed as part of a VB Game Programming for beginners book Soren and I were working on. For a variety of reasons the book idea never came to fruition and so we decided to post the material that is finished as a series of tutorials in the hopes that you would fi
....Read More |
Rating
|
|
|
Read A Custom Clipboard Format
|
Total Hit (2757) |
VB limits you to getting information in just the standard clipboard formats. However, a number of applications paste information in other formats, for example Rich Text Format, HTML format and so forth. This tip shows you how to read the data for a custom format from the clipboard as a string.
....Read More |
Rating
|
|
|
Resampling with Alpha
|
Total Hit (1904) |
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
|
|
|
Enumerating Windows Using the API
|
Total Hit (1956) |
Prior to VB5, it was impossible to use the enumeration methods provided in the Windows API without relying on a proprietary custom control. This was a problem if you wanted to find out all the Windows showing on the system, because the only reliable methods you can use to do this are through enumera
....Read More |
Rating
|
|