devxlogo

Tip Bank

Extracting the Extension of a Filename

The following function returns the extension of the filename that is being passed to it. It also takes into account the facts that a filename can include multiple

A Fast Empty String Compare

It’s faster to retrieve the length of a string and compare the value to zero than it is to compare it to an empty string. This is especially useful in

Handling Pointers Safely

There are various problems regarding pointers that can be handled with the help of macros. Some of these problems are: deleting dangling pointers, deleting pointers other than NULL, and checking

Making a Frame Non-Resizable

Sometimes, you may need to make a Frame or JFrame non resizable. This happens especially when you are using the setBounds method or if you have less components in your

Let ASP determine whether cookies are enabled

Most web sites heavily rely on client-side cookies. For example, ASP Sessions can work correctly only if the browser allows temporary cookies (that are not stored on disk). ASP doesn’t

SetVBASetting – Modify one of the VBA code editor settings

Const HKEY_LOCAL_MACHINE = &H80000002′ modify the value of a setting for the VBA editor from the Registry” Possible values for SettingName are:’ AutoQuickTips2 (0/1)’ AutoStatement2 (0/1)’ AutoValueTips2 (0/1)’ BackGroundCompile (0/1)’

DeleteFileAssociation – Unregister a file extension

Private Declare Sub SHChangeNotify Lib “shell32.dll” (ByVal wEventId As Long, _ ByVal uFlags As Long, ByVal dwItem1 As Long, ByVal dwItem2 As Long)Const SHCNE_ASSOCCHANGED = &H8000000Const SHCNF_IDLIST = 0′ Destroy