none
List ShortCut Names From Desktop

    Question

  • Ok question:

    If i'm using a classic theme/aero off in windows 7 the info of my desktop is as follows:

    WindowClass: Progman

    WindowCaption: Program Manager

    ListViewClass: SysListView32

    ListViewCaption: FolderView

    All of that works fine. I got all the info using Spy++/UISpy. However, here's the problem. When I use Spy++/UISpy while Aero is on (aero theme that allows you to use "Next Desktop Background" (right click desktop), the info is completely different and doesn't work when I try to use FindWindow/FindWindowEX. Since I've been at it all day, I was wondering if someone could help me figure this out. I need the above (window class, caption, listview class, caption) to work in aero.

    This is what I'm doing: stackoverflow/questions/4834788/desktop-icon-manipulation-how-to-get-a-handle-to-syslistview32-when-themes-with

    but I got all the code working, I just need the renamed classes/titles with aero on. please help. :)

    • Edited by CMathewson Monday, July 15, 2013 3:29 AM
    Wednesday, July 10, 2013 5:58 AM

All replies

  • If you are looking for shortcuts that reside on your desktop and that point to applications and files, can't you just use the filesystem and loop over all files available on the desktop and sort out the ones with the .lnk extension and then if needed grab the information from them using the shell API?

    Or am I understanding your question wrong?

    Wednesday, July 10, 2013 7:36 AM
  • You first need to understand that the desktop you see is actually the combined view of two directories:

    The Common Desktop wich all users share
    The user specific desktop.

    You can get both paths by using the SpecialFolders Enumeration:

    http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

    Note that the paths are not fixed. I moved my (user specific) Desktop folder to my D: drive so you have to actually ask Windows what the right path is.

    After you have the list of links from both Folders, come back and explaing what exatly you want to do with the list of Links.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2

    Wednesday, July 10, 2013 8:25 AM
  • Hmm, never though about going this way. What I'm trying to do when my mouse hovers over a desktop icon, a tooltip appears saying the name of the icon.
    Wednesday, July 10, 2013 1:38 PM
  • Hmm, never though about going this way. What I'm trying to do when my mouse hovers over a desktop icon, a tooltip appears saying the name of the icon.

    Okay, now I am totally confused what you want to do:

    - Do you want to change what tooltips is shown in Desktop?

    - Do you want to write your own "Desktop"?

    - Do you want to do somethign totally unrelated and somehow thing that changing the tooltip on the desktop would be a viable solution?

    You also seem to have a missconception here:

    What you have on the Desktop are not icons (.ico files). What you have there are links. A link uses a icon as part of it's drawing - but it is not the icon.
    Another issue is that any one file can contain more then one icon. Most of the Windows default icons are stored in a single .dll (%SystemRoot%\system32\SHELL32.dll). And any programm can contain any number of icons.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2

    Wednesday, July 10, 2013 1:58 PM
  • Oh, I didn't know that lol. I'm so used to calling them desktop icons. Ok, then what I'm trying to do is when my mouse hovers over a desktop shortcut (lets say Internet Explorer.lnk), a tooltip or msgbox or any other alert thing will pop up saying "Internet Explorer.lnk" or just "Internet Explorer". Sorry, my fault. :(

    Also, I already have the code for detecting window titles where the mouse is, if you want it. :)

    So in conclusion: get desktop shortcut name under mouse (or mouse click lol anything with the mouse)

    Wednesday, July 10, 2013 4:21 PM
  • Apparently Customizing the Windows Explorer Tooltips (the desktop is part of the explorer.exe, only the background image is sepereate) can be done via the regsitery. So it is likely not a programming issue. It is more on the line of filetype associations:

    http://www.ghacks.net/2008/02/10/customize-windows-explorer-tooltips/

    http://superuser.com/questions/402172/change-folder-tooltip-on-windows-7

    Note that at least since Windows 7 Links to internet locations (inlcudes psuedo network protocolls like steam://) end on .url.
    Whereas links to local files (inlcuding executeables) end on .lnk (as usual).

    So both use different Tooltips.

    And then there are actuall files/folders placed in the one of the Desktop Folders.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Wednesday, July 10, 2013 7:11 PM
  • Ok guys, check it out. Updated the original post. Please read. :)
    Monday, July 15, 2013 3:29 AM