Solved

Show the Fonts folder on winNT

Posted on 1998-09-09
5
243 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

746 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

11 Experts available now in Live!

Get 1:1 Help Now