José
I am still struggling with 64-bit and trying to find a solution to make OfTheBay work with it.
The "Icolumnmanager" that was suggested elsewhere, do not apply to my case.
What I need exactly to retrieve is, for each of the Desktop Shorcut,
- The name of the shortcut.
- The X,Y location of the matching desktop icon.
- The width, height of the matching destop icon.
etc.
By the way it seems that the IActiveDesktop interface (ShlObj.inc) would do it.
The COMPPOS member of COMPONENT structure seems to have what i am looking for.
Do you have ever worked with this interface?
...
Sorry for the delay. I was getting an invalid parameter error in the call to the GetDesktopItem method and have found that the value of the INTERNET_MAX_URL_LENGTH constant was wrong.
To run the example, you will need to download the updated wininet.inc and shlobj.inc files from: http://www.jose.it-berater.org/smfforum/index.php?topic=2944.new#new
This example is a translation of the one found at http://msdn.microsoft.com/en-us/library/bb776830(VS.85).aspx
#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "shlobj.inc"
FUNCTION PBMAIN () AS LONG
LOCAL hr AS LONG
LOCAL pActiveDesktop AS IActiveDesktop
LOCAL compDesktopItem AS COMPONENT
LOCAL intCount AS LONG
LOCAL intIndex AS LONG
LOCAL strFriendlyName AS STRING
LOCAL strSource AS STRING
LOCAL strSubscribedURL AS STRING
pActiveDesktop = NEWCOM CLSID $CLSID_ActiveDesktop
IF ISNOTHING(pActiveDesktop) THEN EXIT FUNCTION
hr = pActiveDesktop.GetDesktopItemCount(intCount, 0)
FOR intIndex = 0 TO intCount - 1
' //get the COMPONENT structure for the current desktop item
compDesktopItem.dwSize = SIZEOF(COMPONENT)
hr = pActiveDesktop.GetDesktopItem(intIndex, compDesktopItem, 0)
' //Insert code that processes the structure
IF hr THEN
? "Error &H" & HEX$(hr)
ELSE
strFriendlyName = TRIM$(ACODE$(compDesktopItem.wszFriendlyName), CHR$(0))
? strFriendlyName
strSource = TRIM$(ACODE$(compDesktopItem.wszSource), CHR$(0))
? strSource
strSubscribedURL = TRIM$(ACODE$(compDesktopItem.wszSubscribedURL), CHR$(0))
? strSubscribedURL
END IF
' //Insert code to clean-up structure for next component
RESET compDesktopItem
NEXT
pActiveDesktop = NOTHING
WAITKEY$
END FUNCTION
José,
Thank you for the new include files.
I have updated my Jose_WinAPI folder with the latest you just provided, however it doesn't work on VISTA 64.
hr = pActiveDesktop.GetDesktopItemCount(intCount, 0)
intCount is always returning 0
while hr = -2147467263
i am getting realy upset with these 64-bit issues.
:-\
This error means that the IActiveDesktop interface isn't supported in Windows Vista.
In Widows Vista, the Active Desktop has been replaced by Windows Sidebar, that in turn is going to be replaced by the Gadget Platform in Windows 7.
Then, do you know of another interface i could use?