Show the Fonts folder on winNT
Posted on 1998-09-09
From a button in my program I want to open the Explorer, showing the Fonts folder. (Just the window, no common dialog)
At the moment I do this by the following code:
varX = Shell(varWD & "\rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder", 1)
varWD is the variable that represents the windows directory, and I get that by calling GetWindowsDir using the API GetWindowsDirectory function declared as:
Declare Function GetWindowsDirectory Lib "Kernel32" _
Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As Long
I use the varWD variable because the Windows dir can be anywhere: most likely c:\windows, but it could be d:\windows as well.
Not to mention cases where the windows dir is renamed like c:\win98 ...
Now, this works like a charm on Windows95/98 but NOT on winNT...
How should I handle this? I know NT handles the rundll32 calls differently than win95/98, but
this shouldn't lead into a problem, should it?
Perhaps I need to take another approach to this routine?