Move desktop icons
-
Is there a easy way to acces desktop icons and move them around in x and y pos? I think I saw a program that did that a while ago. /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today? -
Is there a easy way to acces desktop icons and move them around in x and y pos? I think I saw a program that did that a while ago. /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today?How about getting a handle to the desktop window, and enumerating its child windows?
-
How about getting a handle to the desktop window, and enumerating its child windows?
Okey sounds interessting but do you have some sample code or an example? I never did it before! /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today? -
Okey sounds interessting but do you have some sample code or an example? I never did it before! /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today?Something like: HWND hDesktop = GetDesktopWindow(); EnumChildWindows(hDesktop, EnumProc, 0); BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam ) { return TRUE; // to continue enumeration } I've not ever needed to do something like this before, but I suspect it will return more windows than just the icons. Top-level applications probably have the desktop as their parent window, too.
-
Something like: HWND hDesktop = GetDesktopWindow(); EnumChildWindows(hDesktop, EnumProc, 0); BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam ) { return TRUE; // to continue enumeration } I've not ever needed to do something like this before, but I suspect it will return more windows than just the icons. Top-level applications probably have the desktop as their parent window, too.
Thank you David! I tryed that to :-) and its just like you said it return manny windows, to manny. But the search goes on I found a VB program that doing this and I am on my way to disassamble the code! I think I have something to learn here It started as an effort to make a funny program but now its a chalange! /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today? -
Thank you David! I tryed that to :-) and its just like you said it return manny windows, to manny. But the search goes on I found a VB program that doing this and I am on my way to disassamble the code! I think I have something to learn here It started as an effort to make a funny program but now its a chalange! /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today?Try this: LPMALLOC pMalloc; LPSHELLFOLDER pDesktopFolder = NULL; HRESULT hResult; LPITEMIDLIST pidlItems = NULL; LPENUMIDLIST ppenum = NULL; ULONG celtFetched; SHFILEINFO fi = {0}; hResult = SHGetMalloc(&pMalloc); if (NOERROR == hResult) { hResult = SHGetDesktopFolder(&pDesktopFolder); if (NOERROR == hResult) { hResult = pDesktopFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &ppenum); if (NOERROR == hResult) { while (hResult = ppenum->Next(1, &pidlItems, &celtFetched) == S_OK && (celtFetched) == 1) { SHGetFileInfo((const char *) pidlItems, 0, &fi, sizeof(fi), SHGFI_PIDL | SHGFI_ICON | SHGFI_DISPLAYNAME); TRACE2("Icon handle for ]%s[ = %#x\n", fi.szDisplayName, fi.hIcon); pMalloc->Free(pidlItems); } ppenum->Release(); } pDesktopFolder->Release(); } }
-
Try this: LPMALLOC pMalloc; LPSHELLFOLDER pDesktopFolder = NULL; HRESULT hResult; LPITEMIDLIST pidlItems = NULL; LPENUMIDLIST ppenum = NULL; ULONG celtFetched; SHFILEINFO fi = {0}; hResult = SHGetMalloc(&pMalloc); if (NOERROR == hResult) { hResult = SHGetDesktopFolder(&pDesktopFolder); if (NOERROR == hResult) { hResult = pDesktopFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &ppenum); if (NOERROR == hResult) { while (hResult = ppenum->Next(1, &pidlItems, &celtFetched) == S_OK && (celtFetched) == 1) { SHGetFileInfo((const char *) pidlItems, 0, &fi, sizeof(fi), SHGFI_PIDL | SHGFI_ICON | SHGFI_DISPLAYNAME); TRACE2("Icon handle for ]%s[ = %#x\n", fi.szDisplayName, fi.hIcon); pMalloc->Free(pidlItems); } ppenum->Release(); } pDesktopFolder->Release(); } }
Thank you David! It works I can get the Desktopicons :-) I saw similar code in Q&A on MSDN Thank you again your code was better. /Jarek He believed the commercials that said drink beer, get laid but at closin' time he was alone, he didn't get paid. Last night his lover was a razorblade.. "Dan Reed song Mix it up"
What do you want to patch today?