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. SHGetIconOverlayIndex & GetProcAddress

SHGetIconOverlayIndex & GetProcAddress

Scheduled Pinned Locked Moved C / C++ / MFC
comhelp
2 Posts 2 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.
  • Y Offline
    Y Offline
    yarp
    wrote on last edited by
    #1

    I've already used the GetProcAddress function for half a dozen functions but it seems I've got a problem with that one. Might be a problem with the prototyping but there are few pages about it on the web and it is the first SH* function I try to get the address for. I tried all the prototypes I could imagine WINAPI, STDAPI, STDAPICALLTYPE with extern "C", dllimport and other __cdecl, __stdcall gave nothing. So here's the code, any idea welcome: typedef int (__stdcall *LPFNSHGETICONOVERLAYINDEX)(LPCSTR, int); HMODULE hMod = ::GetModuleHandle(_T("Shell32.dll")); if (hMod) { LPFNSHGETICONOVERLAYINDEX lpfnSHGetIconOverlayIndex; lpfnSHGetIconOverlayIndex = (LPFNSHGETICONOVERLAYINDEX)GetProcAddress(hMod,_T("SHGetIconOverlayIndex")); if (lpfnSHGetIconOverlayIndex) { // There it fails m_nIndexOverlay = lpfnSHGetIconOverlayIndex("C:\\", IDO_SHGIOI_LINK); } } Yarp http://www.senosoft.com/

    K 1 Reply Last reply
    0
    • Y yarp

      I've already used the GetProcAddress function for half a dozen functions but it seems I've got a problem with that one. Might be a problem with the prototyping but there are few pages about it on the web and it is the first SH* function I try to get the address for. I tried all the prototypes I could imagine WINAPI, STDAPI, STDAPICALLTYPE with extern "C", dllimport and other __cdecl, __stdcall gave nothing. So here's the code, any idea welcome: typedef int (__stdcall *LPFNSHGETICONOVERLAYINDEX)(LPCSTR, int); HMODULE hMod = ::GetModuleHandle(_T("Shell32.dll")); if (hMod) { LPFNSHGETICONOVERLAYINDEX lpfnSHGetIconOverlayIndex; lpfnSHGetIconOverlayIndex = (LPFNSHGETICONOVERLAYINDEX)GetProcAddress(hMod,_T("SHGetIconOverlayIndex")); if (lpfnSHGetIconOverlayIndex) { // There it fails m_nIndexOverlay = lpfnSHGetIconOverlayIndex("C:\\", IDO_SHGIOI_LINK); } } Yarp http://www.senosoft.com/

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      Try SHGetIconOverlayIndexA or SHGetIconOverlayIndexW :-D

      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