Solved

Show the Fonts folder on winNT

Posted on 1998-09-09
5
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

734 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