Solved

Show the Fonts folder on winNT

Posted on 1998-09-09
5
244 Views
Last Modified: 2013-12-03
Hello,

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:

Dim varX
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?


Kind regards,
David.
0
Comment
Question by:bluefive
  • 3
  • 2
5 Comments
 

Author Comment

by:bluefive
ID: 1433939
Edited text of question
0
 

Author Comment

by:bluefive
ID: 1433940
Edited text of question
0
 
LVL 6

Accepted Solution

by:
clifABB earned 300 total points
ID: 1433941
Sometimes the simple answer is the best:
varX = Shell("explorer.exe " & varWD & "\fonts", vbNormalFocus)
0
 

Author Comment

by:bluefive
ID: 1433942
Dim varX
varX = Shell("rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder", 1)

Could this be a (simple) solution as well?
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1433943
Yep.
Personally I've never used rundll.exe.  Perhaps I should look into it.  :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now