Read back the result into your app's POINT using API ReadProcessMemory(). Send LVM_GETITEMPOSITION to Explorer specifying a pointer to this structure. I use LVM_GETITEMPOSITION as an example, which requires a pointer to a POINT structure.Īllocate a mirror structure in Explorer's address space using API VirtualAllocEx(). These structures must be in Explorer's address space not my app's, so some trickery is needed. These messages are fairly simple to use with one complication: some require pointers to parameter structures. To access the items, we can use several Windows messages: LVM_GETITEM, LVM_GETITEMCOUNT, LVM_GETITEMPOSITION and LVM_SETITEMPOSITION. Any changes are immediately visible on change, and are saved on exit. The right way to manipulate desktop items is to directly manipulate items in the ListView. So modifying the file would not help because it would be overwritten on exit. On exit, it re-writes that file from the ListView. At startup, Explorer reads info from some arcane file and populates the ListView. Here is what I learned:Įxplorer.exe displays desktop items in a giant ListView covering the whole desktop with ListView items corresponding to each visible icon. My original question concerned locating, reading and writing to the file where the icon info is stored, but this is not a useful approach. I finally figured out how to do what I want (display and re-arrange desktop icons). See "WIN10 ADDENDUM" at the end of this answer. I believe because of a change in the desktop internals. I just switched over to a Win10 64-bit machine and find the solution below no longer works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |