Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to Run charmap.exe with a chosen font?

How to Run charmap.exe with a chosen font?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Burkhart
    wrote on last edited by
    #1

    I'd like to have charmap.exe open with the same font I'm using in my application's main window. But I've had no success passing arguments to it. I had assumed that:

    Process.Start("charmap.exe", "Arial")

    would get it done. But this has no effect. Suggestions?

    XAlan Burkhart

    D T M 3 Replies Last reply
    0
    • A Alan Burkhart

      I'd like to have charmap.exe open with the same font I'm using in my application's main window. But I've had no success passing arguments to it. I had assumed that:

      Process.Start("charmap.exe", "Arial")

      would get it done. But this has no effect. Suggestions?

      XAlan Burkhart

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      That's because CharMap doesn't take any command line arguments. AFAIK, the only way to open it at a specific font would be to launch it, make sure the window has the focus and then use SendKeys to send the font name, essentially typing it into the drop down list in CharMap.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        That's because CharMap doesn't take any command line arguments. AFAIK, the only way to open it at a specific font would be to launch it, make sure the window has the focus and then use SendKeys to send the font name, essentially typing it into the drop down list in CharMap.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        A Offline
        A Offline
        Alan Burkhart
        wrote on last edited by
        #3

        I had considered this but was wanting to send arguments instead. But SendKeys works perfectly. Thanks much for the info.

        XAlan Burkhart

        D 1 Reply Last reply
        0
        • A Alan Burkhart

          I had considered this but was wanting to send arguments instead. But SendKeys works perfectly. Thanks much for the info.

          XAlan Burkhart

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Arguments only work when the target app is expecting them, and only if you use the switches it expects.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          • A Alan Burkhart

            I'd like to have charmap.exe open with the same font I'm using in my application's main window. But I've had no success passing arguments to it. I had assumed that:

            Process.Start("charmap.exe", "Arial")

            would get it done. But this has no effect. Suggestions?

            XAlan Burkhart

            T Offline
            T Offline
            TnTinMn
            wrote on last edited by
            #5

            You can do this via the registry.

            Dim CharMap_Key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\CharMap", writable:=True)
            Dim currentfont As String = CStr(CharMap_Key.GetValue("Font", defaultValue:=""))
            CharMap_Key.SetValue("Font", "Arial")
            Dim proc As Process = Process.Start(Environment.SystemDirectory & "\charmap.exe")

            1 Reply Last reply
            0
            • A Alan Burkhart

              I'd like to have charmap.exe open with the same font I'm using in my application's main window. But I've had no success passing arguments to it. I had assumed that:

              Process.Start("charmap.exe", "Arial")

              would get it done. But this has no effect. Suggestions?

              XAlan Burkhart

              M Offline
              M Offline
              Marco Bertschi
              wrote on last edited by
              #6

              In my case, charmap.exe already opens with "Arial" as the selected value - Of course, if you have a different font in your app you'll need to go the SendKeys-Way.

              :bob:


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups