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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help needed to get desktop selected/highlighted shortcut

help needed to get desktop selected/highlighted shortcut

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasehelp
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.
  • S Offline
    S Offline
    sumon2002
    wrote on last edited by
    #1

    i want to get the information and icon of shortcut of desktop by selecting with mouse. i get the list view of desktop shortcut and also i can get the selected index number of shortcut. i am using VC++6.0 and windows 2000 professional. "what i want is to get the icon image and icon name and shortcut link file name". the following code i am using. Mouse hooking is not needed. HWND hWnd = ::FindWindow("Progman", NULL); if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SHELLDLL_DefView", NULL); if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SysListView32", NULL); if (NULL != hWnd) { UINT count = ListView_GetSelectedCount( hWnd ); INT mark = ListView_GetSelectionMark( hWnd ); int nItem = ListView_GetItemCount( hWnd ); ... ... ... }

    D 1 Reply Last reply
    0
    • S sumon2002

      i want to get the information and icon of shortcut of desktop by selecting with mouse. i get the list view of desktop shortcut and also i can get the selected index number of shortcut. i am using VC++6.0 and windows 2000 professional. "what i want is to get the icon image and icon name and shortcut link file name". the following code i am using. Mouse hooking is not needed. HWND hWnd = ::FindWindow("Progman", NULL); if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SHELLDLL_DefView", NULL); if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SysListView32", NULL); if (NULL != hWnd) { UINT count = ListView_GetSelectedCount( hWnd ); INT mark = ListView_GetSelectionMark( hWnd ); int nItem = ListView_GetItemCount( hWnd ); ... ... ... }

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

      Ok, so is your code working? If not, what errors are you getting (e.g., compiler, linker, runtime)? Is the value of count, mark, and nItem correct? Have you considered SHGetFolderPath() with either CSIDL_COMMON_DESKTOPDIRECTORY or CSIDL_DESKTOPDIRECTORY? With the path, you can then use FindFirstFile() and FindNextFile() to "find" each file in the folder. Then you can use ExtractIcon() to get the icon used by the file. I've not tried this specifically, so your mileage may vary.


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      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