flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > Desktop Icons Position Saver & Restorer |
Author |
|
asmfan 11 Oct 2008, 12:07
Program on first run saves position of all desktop icons to unicode-aware file. On 2nd run it restores icons' position accordingly to saved file. If newly created icon isn't in the list it saves its position to file. Position is saved to file even if icon deleted from desktop. If you need new position for old icon just rebuild icons' position database (delete it and create again with new needed icon position).
Unicode program in 2 versions - verbose and silent. Copyrighted just in case /dunno why but anyway/ - a good tradition to study to. Tested on XP SP3+ 32bit for windows names (see inside). If doesn't work please check with WinSpy for correct class & windows names for "SysListView32" child under "Progman". Known Issue: sometimes (rare) it fail to find needed child window. This related to "busy" explorer while processing messages for retrieving window's name. This behavior is described for findwindow(ex) api. ______ * fixed a bug that overwrites icon positions in ini file with bogus coordinates that were obtained after restoring icons position with "align to grid" option is checked on desktop. * fixed "xor" bug leading to approx. 1.6% possibility that program will give wrong ini file filename. * extended buffers now able to hold all possible unicode string sizes. * fixed issue with "snap to grid" that messed icons while restoring them * added x64 version P.S. You can get false positive because it reads Explorer's list control memory via new remote memory allocation/injection.
_________________ Any offers? Last edited by asmfan on 23 Sep 2009, 08:52; edited 5 times in total |
|||||||||||||||||||||||||||||||
11 Oct 2008, 12:07 |
|
revolution 11 Oct 2008, 17:14
sleepsleep wrote: does it support window location restoration? |
|||
11 Oct 2008, 17:14 |
|
sleepsleep 12 Oct 2008, 06:59
but hibernation/standby still requires power right?
i mean for pc that requires shutdown, no more power coming in... hope that clarify. |
|||
12 Oct 2008, 06:59 |
|
revolution 12 Oct 2008, 07:22
Standby requires power to keep the SDRAM contents.
Hibernation only requires disk space, no batteries required. |
|||
12 Oct 2008, 07:22 |
|
sleepsleep 12 Oct 2008, 07:46
ic, thanks for the info. but still hope it could save window location and restore.
|
|||
12 Oct 2008, 07:46 |
|
asmfan 12 Oct 2008, 08:07
Win->Control Panel->Folder Properties->View->Restore windows on Logon. Something like this.
|
|||
12 Oct 2008, 08:07 |
|
asmfan 16 Oct 2008, 17:33
added "jmp" instruction that fixes bug with overwriting ini file with bogus coordinates for icon when "align to grid" is checked on desktop.
To restore icons with that option checked just run the app several times untill needed result. Or the easiest way - uncheck "align to grid" then run app once, check 'align to grid'. |
|||
16 Oct 2008, 17:33 |
|
bitRAKE 16 Oct 2008, 21:03
Code: invoke GetModuleFileName, ebx, szFile, MAX_PATH cmp eax,MAX_PATH jae @5 lea edi,[eax*2+szFile] lea ecx,[eax+1] mov al,'.' std repne scasw _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
16 Oct 2008, 21:03 |
|
asmfan 17 Oct 2008, 13:35
yup... seems like it's ANSI but unicode intended
lack of xor here, thanks. It's 4 out of 259 (1.5%) to get wrong result though OK i'll fix & extend to unicode string size limits not just MAX_PATH. Now fixed & code restructed _________________ Any offers? |
|||
17 Oct 2008, 13:35 |
|
asmfan 20 Oct 2008, 11:14
anyone tested it on 64bit OS or on any of Vista? Are there window classes & names the same as on 32bit XP?
|
|||
20 Oct 2008, 11:14 |
|
asmfan 25 Oct 2008, 14:14
fixed "snap to grid" option is set problem that caused messed icons during restoration process. The cause is that icons "move" each other if overlayed and hence losing positions.
|
|||
25 Oct 2008, 14:14 |
|
sinsi 29 Oct 2008, 10:50
One thing I found from the PSDK about LVM_GETITEM -
Quote: If the LVIF_TEXT flag is set in the mask member of the LVITEM structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer. Applications should not assume that the text will necessarily be placed in the specified buffer. The control may instead change the pszText member of the structure to point to the new text, rather than place it in the buffer. Not sure if it applies to LVM_GETITEMTEXT as well though... |
|||
29 Oct 2008, 10:50 |
|
asmfan 29 Oct 2008, 15:56
Nothing about such behaviour of LVM_GETITEMTEXT on msdn also but on LVM_GETITEM it is so. Haven't met such buffer relocation during usage of app, maybe this is related to insufficient buffer size passed which in my case is sufficient enough Hope this LVM_GETITEM remark isn't related LVM_GETITEMTEXT.
|
|||
29 Oct 2008, 15:56 |
|
asmfan 04 Jun 2009, 09:10
Recently moved to x64 needed some system restoration. Now you can use x64 version of icon saver/restorer in first post.
|
|||
04 Jun 2009, 09:10 |
|
Pinecone_ 13 Sep 2009, 14:56
I dont mean to take away from your project, but maybe you should check out fences by stardock.
|
|||
13 Sep 2009, 14:56 |
|
asmfan 23 Sep 2009, 08:50
nah, it's just a tiny icon restorer for fresh os installation when bunch of icons previously saved and supposed to be on proper place on desktop.
|
|||
23 Sep 2009, 08:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.