October 2, 1999

Check whether a sound card exists

If you are developing a game in VB or an application that plays sounds, you probably want to check that a sound card actually exists. There is an API function that does this, and returns the number of sound cards installed in the system. Therefore, a return value of zero

Show the contents of the Recycle Bin folder

You can use the ShellExecute API function to programmatically open a window of Explorer and display the contents of the Recycle Bin. This is the function’s declare: Private Declare Function ShellExecute Lib “shell32.dll” Alias “ShellExecuteA” _ (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal

RecycleBinItems – Get info on the items in the Recycle Bin

Option ExplicitPrivate Type SHQUERYRBINFO cbSize As Long ‘ bytes in this structure i64Size As Currency ‘ 64-bit integer with size of items in the Recycle ‘ Bin i64NumItems As Currency ‘ 64-bit integer with number of items in the ‘ Recycle BinEnd TypePrivate Declare Function SHQueryRecycleBin Lib “shell32.dll” Alias _

EmptyRecycleBin – Delete all files in the Recycle Bin

Private Declare Function SHEmptyRecycleBin Lib “shell32.dll” Alias _ “SHEmptyRecycleBinA” (ByVal hWnd As Long, ByVal pszRootPath As String, _ ByVal dwFlags As Long) As LongConst SHERB_NOCONFIRMATION = &H1Const SHERB_NOPROGRESSUI = &H2Const SHERB_NOSOUND = &H4′ Empty all the files in the Recycle Bin.” If RootPath is a null string, it affects the

Managing Inactivity Timeouts

ne way to implement an inactivity timeout in an application is to keep track of the last time a MouseEvent or KeyEvent was sent to an application. In a separate thread, set a timer that checks periodically if the difference between the current time and the timestamp is greater than

Display Selective Data From a Database

n last month’s 10-Minute Solution, you learned how to display data from a database. This time, you’ll see how to use this technique to pick and choose what to display from the database based on the user’s choice. Before you begin, you need to get your database ready. You can

Convert a Text File to XML

ere’s an interesting conundrum. You have an application that doesn’t have an object model (or has one that’s so hideously complex that you’d just as soon not pay a programmer three months’ wages just to build a matching automation interface). The details of the program are unimportant, except that it

Addressing User Comments About Performance Issues

he experience of answering e-mail to the SQL Server Pro on DevX has made me appreciate the limits of my knowledge and experience. Some questions are funny because they are so broad: “I need to design a Web site using ADO and SQL Server. Please post the code.” Others send

Outlook View Control

he Outlook View control released by Microsoft allows you to display an Outlook folder in your application. The folder displayed in the control is fully functional; you can create, open, and delete items. In addition, you can right-click on an item and choose a command from the pop-up menu. With