Note that there are some explanatory texts on larger screens.

plurals
  1. POShell32.dll .NET interface is dependent from the OS
    primarykey
    data
    text
    <p>I want to find every application listed in the user program menu. I use the following routine:</p> <pre><code>private static void ProcessDirectoryLnkFiles(string path, bool recurse, UpdateProcessFromLnkDelegate sProcFile) { try { string[] sPrograms = Directory.GetFiles(path, "*.lnk", SearchOption.TopDirectoryOnly); string[] sSubdirs = Directory.GetDirectories(path); Shell32.Shell shell = new Shell32.Shell(); foreach (string p in sPrograms) { Shell32.Folder sLinkFolder; Shell32.FolderItem sLinkFolderItem; Shell32.ShellLinkObject sLinkObject; string sLinkFullpath; // Get link full path sLinkFullpath = Path.GetFullPath(p); // Get link folder sLinkFolder = shell.NameSpace( Path.GetDirectoryName(sLinkFullpath)); // Get link item sLinkFolderItem = sLinkFolder.Items(). Item(Path.GetFileName(sLinkFullpath)); // Get link object sLinkObject = (Shell32.ShellLinkObject) sLinkFolderItem.GetLink; if (sLinkObject.Target.IsFolder == false) sProcFile(sLinkObject); } if (recurse == true) foreach (string dir in sSubdirs) ProcessDirectoryLnkFiles(dir, true, sProcFile); } catch (UnauthorizedAccessException eUnauthorizedAccessException) { sLog.Warn("Unable to iterate on directory {0} ({1}).", path, eUnauthorizedAccessException.Message); } catch (IOException eIOException) { sLog.Warn("Unable to iterate on directory {0} ({1}).", path, eIOException.Message); } catch (COMException eCOMException) { } catch { throw; } } </code></pre> <p>This runs quite well on Windows 7 x64. But unfortunately, on Windows XP x86 the <code>Shell32.Shell</code> object doesn't declare the <code>Shell32.Shell.Target</code> property. How do I make this code run on Windows XP?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload