Solved

Retrieving desktop icon positions...

Posted on 1998-03-10
2
460 Views
Last Modified: 2013-11-20
Greets all,

I'm trying to retrieve the positions of all the icons on the desktop in 95 using VC++.  
Any idea how to go about it?  

I've already tried grabbing the SysListView32 window and using the ListView_GetItemPosition
macro to attempt this, but it crashes Explorer every time I try.  The amusing/annoying thing is, I
CAN do a ListView_GetSelectedCount call using the same hwnd and get a valid answer.  Most
of the other ListView_* macros crash explorer as well, with some notable exceptions.  Is this
information in the registry somewhere?  Any hints or other possible directions to try would be
appreciated.

- Tnerb
0
Comment
Question by:tnerb
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1316883
The problem stems from your assumption that the new common controls work similarly to the standard controls, they don't. The standard controls have code to copy data from one process to another. So when you send a control the WM_GETTEXT message, Windows has code to copy the text from the address space of the control into your address space. However, this code does not apply to the new common controls. So you cannot get to any of its API from another process.

That means the only way you can get to that information is if you were in the same process space of that window. This means you will have to create a DLL and insert into the process. You can do this fairly easily with a system hook. Then you will need to provide some interprocess communication with that DLL. You can subclass the desktop's window, provide a registered window message to communicate back and forth to get to the data.


0
 

Author Comment

by:tnerb
ID: 1316884
Ah.  Afraid it was something along those lines.  Thanks!  I'll
give it a shot.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now