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. C / C++ / MFC
  4. about path

about path

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 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.
  • V Offline
    V Offline
    vividtang
    wrote on last edited by
    #1

    i can use the following get the notepad icon from other program,and draw the icon on my view. (1)if( :: SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0, &stFileInfo,sizeof(stFileInfo),SHGFI_ICON)) {pDC ->DrawIcon(10,10,stFileInfo.hIcon); } but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe",by using the string operator "+",now i get str,if in console ,use cout<

    D 1 Reply Last reply
    0
    • V vividtang

      i can use the following get the notepad icon from other program,and draw the icon on my view. (1)if( :: SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0, &stFileInfo,sizeof(stFileInfo),SHGFI_ICON)) {pDC ->DrawIcon(10,10,stFileInfo.hIcon); } but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe",by using the string operator "+",now i get str,if in console ,use cout<

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      vividtang wrote: ...but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe Read the second part of my response here. It's not a good idea to assume that notepad.exe resides in any directory, or even exists for that matter. Without knowing more of what you are doing, I'm inclined to think that FindExecutable() (or AssocQueryString()) might be a better choice for what you want.


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      M 1 Reply Last reply
      0
      • D David Crow

        vividtang wrote: ...but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe Read the second part of my response here. It's not a good idea to assume that notepad.exe resides in any directory, or even exists for that matter. Without knowing more of what you are doing, I'm inclined to think that FindExecutable() (or AssocQueryString()) might be a better choice for what you want.


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        DavidCrow wrote: Without knowing more of what you are doing, I'm inclined to think that FindExecutable() (or AssocQueryString()) might be a better choice for what you want. oh, nice, I learned something today ... !!!! Thanks ...


        Maximilien Lincourt Your Head A Splode - Strong Bad

        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