Jump to content

elsemieni

Members
  • Posts

    2
  • Joined

  • Last visited

elsemieni's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hey hello. I came here with maybe too specific questions about uncommon things, but as people says, I don't lose anything trying to asking here There's long time that I have a little "experimental" idea: Use windows desktop and it icon system like old videogame consoles (where "sprites" are used to draw things on screen, can be manipulated/animated to make interesting things happen). Some of that inspiration came from another experiments from demoscene. Researching the possibilities of doing something like that (maybe not so intense) I found that the Windows Desktop uses a GuiListView to show and arrange icons (and of course, AutoIt provides UDF's for that ). So, I'm used that UDF to create dummy icons (not putting files on Desktop, just modifiying the "GUI layer" of desktop for put non-working icons), setting custom values like coordinates, name and Icon (from a list of loaded icons in the GuiListView). As you can see in next image works well in Windows XP... even in Windows 95 (that's not the case from Windows Vista to 10, but I already posted another question here about that... anyways, for now I'm working that with a isolated XP machine... sigh). Another video doing an animation with that: How I make that custom icons? Here: $hWnd = ControlGetHandle("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]") $newItem = _GUICtrlListView_AddItem ( $hWnd, "TEST", 32 ) ; with an icon of index 32 _GUICtrlListView_SetItemPosition ( $hWnd, $newItem, 300, 300 ) ; set some example property. Put in X=300 Y=300 Okay, so the next phase was changing the icons with custom ones. And here starts the issues. As AutoIT help says, icons from GuiListView came from a loaded GUIImageList, which, seeing past images I conclude that it's already preloaded with some sort of most used icons (something like an icon cache?). But If I modify it (or create another GUIImageList and then put into the GuiListView) the icons became corrupted and replaced with blank ones. (can be reverted deleting IconCache.db, just like when windows shows wrong icons in desktop). How I change icons? Here $hImage = _GUIImageList_Create(48, 48, 5) ; create an image list for 48x48 icons $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; just adding a new icon in the image list _GUICtrlListView_SetImageList($hWnd, $hImage, 0) ; $hwnd is the desktop hwnd Another option as workaround for setting icons was getting the desktop GUIImageList, and modifiyng it directly. I otbtain a GUIImageList handle, but ... without any images inside! (That's strange beacuse, when I set desktop item icons without altering the GUIImageList, it applies correctly). And finally if I try to add new ones, it returns -1 with @error setted. How I'm trying to get desktop GUIImageList? Here. $imageList = _GUICtrlListView_GetImageList ( $hWnd, 0 ) MsgBox(0,_GUIImageList_GetImageCount ( $imageList ), $imageList) ; getting image count and GUIImageList handle $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; adding icons without success So, what is the question? There's something wrong I'm doing while trying to set the new icon set on desktop? Or desktop icons work in different way than the rest of the GuiListView's? Or there's something really stupid that I can't saw before that corrupts the icons? Also... if there's not known solution for that, do you have some idea for doing a workaround for that? Or another crazy idea? (Maybe putting real files instead dummy icons could be a solution ... a very slow one). Or even maybe (maybe not, I sure about that xD) do you want to help with this "experiment". Thanks in advance, have a good day
  2. Hello there! I'm trying to build something for animating desktop icons (adding/removing/change position/icon/properties). After a little research, I figure that Windows Desktop is in fact a ListView, that can be manipulated with the included GuiListView.au3 UDF. So, I made some small demo to see how works, but I have different results in different Windows versions. Demo objectives: Obtain the HWND of the desktopListView. Add a dummy icon in the desktop. Changing some properties (position, label). Show current desktop icons info. Here's the code I made for that: #Include <GuiListView.au3> #include <Array.au3> $hWnd = ControlGetHandle("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]") ;adding new dummy icon $nuevoControl = _GUICtrlListView_AddItem ( $hWnd, "TEST", 32, 2 ) ;changing some properties _GUICtrlListView_SetItemPosition ( $hWnd, $nuevoControl, 300, 300 ) _GUICtrlListView_SetItemText ( $hWnd, $nuevoControl, "text" ) ;show desktop icons info $aDeskIcon = GetIconInfo() _ArrayDisplay($aDeskIcon, "Desktop shortcut names and icon positions") Func GetIconInfo() Local $hWnd = ControlGetHandle("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]") If @error Then Return 0 Dim $GIP[_GUICtrlListView_GetItemCount($hWnd)+1][4] If Not IsArray($GIP) Then Return 0 $GIP[0][0] = UBound($GIP) -1 For $i = 1 To $GIP[0][0] $GIP[$i][0] = _GUICtrlListView_GetItemText($hWnd, $i -1) $GIP[$i][1] = _GUICtrlListView_GetItemPositionX($hWnd, $i -1) $GIP[$i][2] = _GUICtrlListView_GetItemPositionY($hWnd, $i -1) $GIP[$i][3] = _GUICtrlListView_GetItemImage ( $hWnd, $i -1) Next Return $GIP EndFunc Here's the behaivour between different OSes (32 bit OS, 32bit AutoIt3): Windows 9x-XP : It works fine (Yes, tested in windows 95 too and works pretty well xD). It add's a new dummy visible icon, then it moves to 100,100 with name "text" and shows all icon's info correctly. Windows 7: It doesn't create any icon. _GUICtrlListView_AddItem returns 999999999 which it's an unexpected value (in UDF documentation tells there's a -1 value if there's an error). If I use _GUICtrlListView_InsertItem instead _GUICtrlListView_AddItem it creates a dummy empty icon but I can't change any properties of them. Windows 10: Doesn't create any icons, can't read any icon from Desktop. I researched some things about this and I'm just figuring some differences in how Windows renders the screen since Vista (GPU v/s software), but I don't think that affects desktop structure. So my question is: There's something wrong how I'm manipulating icons in Windows 7? (I can live without 10, that's not a problem hehe). Or my approach to handle it was wrong? There's another efficent way to handle desktop icons to make animations? Some idea you can tell us everybody here? Thanks in advance
×
×
  • Create New...