Jump to content



Photo

Getting the text of an icon on the desktop

listview desktop

  • Please log in to reply
5 replies to this topic

#1 Shaggi

Shaggi

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 296 posts

Posted 30 June 2012 - 03:36 PM

Been stuck in this for a day now. As far as i know, the desktop's a syslistview32 control, where icons on the desktop is items, right?
Therefore i should be able to get the icon text using LVM_GETITEMTEXT?

using this code:
for item in GetListViewItems(hList)      debugout(consolewrite, GetItemText(hList, item)) next

where GetItemText is:
Spoiler

And hList is a class SysListView32 belonging to the progman window.
Output is:
0x01000000 + item + 000000000000000000000000000000 3C007D06FF (pointer to buffer at end) ... (zero'es) [chars = 0] The operation completed successfully. [empty string]


Does anybody know what's going on? I'll admit i dont have a lot of knowledge about listviews, but this is the way that both msdn and general searching suggests (check out this link: http://social.msdn.microsoft.com/Forums/eu/winforms/thread/d7df8a4d-fc0f-4b62-80c9-7768756456e6)

Using autoit beta x64 (irrelevant though, tried in other languages too), and windows 7 x64.

Any help appreciated .. :D
Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG







#2 abberration

abberration

    Prodigy

  • Active Members
  • PipPipPip
  • 183 posts

Posted 30 June 2012 - 11:57 PM

I think you are making it more complicated than it needs to be. Why not just do something like this:

#include <file.au3> #include <array.au3> $list = _FileListToArray(@DesktopDir, "*.lnk", 1) _ArrayDisplay($list)


#3 Shaggi

Shaggi

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 296 posts

Posted 01 July 2012 - 12:35 PM

I think you are making it more complicated than it needs to be. Why not just do something like this:

#include <file.au3> #include <array.au3> $list = _FileListToArray(@DesktopDir, "*.lnk", 1) _ArrayDisplay($list)

I need to be able to get/set the icons positions, get the icon etc.. :)
Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

#4 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 01 July 2012 - 01:08 PM

You can use FileGetShortcut returns an array with all that info.

#5 Shaggi

Shaggi

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 296 posts

Posted 01 July 2012 - 01:35 PM

You can use FileGetShortcut returns an array with all that info.

only works for shortcuts, and i would still need to arrange the icons on the desktop
Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

#6 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 01 July 2012 - 02:25 PM

It sounds like you're looking to do something similar to what Kafu did here, you might want to take a look at how he did it and adapt to your needs.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image






Also tagged with one or more of these keywords: listview, desktop

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users