Solved

Show the Fonts folder on winNT

Posted on 1998-09-09
5
250 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 Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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