April 24, 1999

Is the Active Desktop Active?

Sometimes you want to know if the desktop is in Active Desktop mode-for example, to set an HTML wallpaper. I couldn’t find a function to accomplish this, but this hack works on all Windows 95/98 and NT4 desktops that I’ve tested it on: Private Declare Function FindWindow& Lib “user32” Alias

Grab System Fonts Easily

At times, you might want to retrieve the current system font settings, such as the font being used for window title bars, or the menu or message box font. You could delve into the Registry, but why go to the trouble if the SystemParametersInfo API does it for you? Here’s

Make Sure Data is Updated

When using bound controls, data is updated automatically when you Move to a different record. Data is not updated when you close the form. To ensure that data is saved when you close, perform a Move 0. This saves the changes before unloading the form.

Setting the Log Stream

When debugging Java Database Connectivity (JDBC) problems, it can be difficult to locate the source of errors. However, one facility that can be used to accomplish this is the logging/tracing stream used by JDBC. Most JDBC drivers write information to the stream that can be helpful in debugging errors. You

Replace Form Buttons With Images

Let’s face it–the default gray buttons that come with all browsers to go along with HTML forms are not very attractive. If you have a good look and feel going with your site, it’s a shame to mess it up with bland gray submit buttons for the forms. Fortunately, you

Defining Static Data Members of a Template

Templates can have static data members. A definition for a static data member can appear in a namespace scope enclosing the definition of the class template that contains the static member. For example: template class C {public: static T stat; //declaration};template T C::stat = 5; //definition A static data member

Debugging Connectivity Problems

Identifying and solving connectivity problems is a frustrating process. Here are some hints to make your life easier. First, verify that you can connect to your server outside of SQL Server. Try connecting to a drive on the same machine. If you are using TCP/IP, ping the machine and see

Is the NT Screen Saver Running?

Use this code to determine whether NT is running on its screen saver desktop. NT5 has an SPI function, but this code should work on any NT version: Private Declare Function OpenDesktop& Lib “user32” Alias _ “OpenDesktopA” (ByVal lpszDesktop$, ByVal dwFlags$, _ ByVal fInherit&, ByVal dwDesiredAccess&) Private Declare Function CloseDesktop&

Loop on Non-Numeric Indices

You might occasionally need to execute a group of statements with different and unrelated values of a variable. For example, say you need to verify that a number isn’t a multiple of 2, 3, 5, 7, or 11. In these circumstances, you can’t use a regular For…Next loop, unless you

No more posts to show