Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show the Fonts folder on winNT

Posted on 1998-09-09
5
Medium Priority
?
253 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 1200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

972 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