March 4, 2000

Determine the number of mouse buttons

Sometimes is useful to know how many buttons the user’s mouse has. This value can be obtained by calling GetSystemMetrics. The constant to pass as parameter is SM_ CMOUSEBUTTONS. Here’s an example: Const SM_CMOUSEBUTTONS = 43Private Declare Function GetSystemMetrics Lib “user32” (ByVal nIndex As Long) _ As LongFunction GetNumMouseButtons() As

Open a Control Panel dialog or wizard

Have you ever needed to open a Windows dialog such as Internet Properties, New Hardware, Modem Properties or any other dialog you can find in the Control Panel? Well, it’s very simple, onve you know the trick. All these dialogs are implemented in files with the CPL extension. (They’re actually

How did Windows start?

If you need to know how Windows was started you have just to call an API function: GetSystemMetrics. Passing the SM_CLEANBOOT constant as parameter, the function returns a Long value with this meaning:0 = Normal boot1 = Fail-safe boot2 = Fail-safe with network bootHere ia an example that shows how

Create a simple Windows inspector

It takes only a handful of lines of code to create Windows inspector program, that is, an utility that lets you display the handle, the class name and the contents (Text or Caption) of the window under the mouse cursor.To create such a program, create a small form, add a

Open the Internet Connection dialog

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 the connection you

Hide the application in the Task List dialog

As you know, when you press CTRL+ALT+CANC the Task List window appears. This dialog allows you to see all the running processes and also to terminate them. If you don’t want that your application be closed, you can prevent the application from being displayed in the Task List dialog, by

Manipulate Dates With VBScript’s DateAdd Function

Browsers Targeted: Internet Explorer 4+ Dates can be a pain to deal with when working with scripting. Fortunately VBScript 5.0 supports a number of different functions that can simplify the process of manipulating dates. For example, consider the case where you want to retrieve the date one month from now.