Exemple #1
0
        public IShellLink LoadLink(string linkFile)
        {
            var data = (IPersistFile)Shell32.CreateShellLink();

            data.Load(linkFile, 0);
            var link = (IShellLink)data;

            link.Resolve(OwnerHwnd, SLR_FLAGS.SLR_UPDATE);
            return(link);
        }
Exemple #2
0
        public IShellLink LoadLink(byte[] linkData)
        {
            var data = (IPersistStream)Shell32.CreateShellLink();

            using (var buffer = new MemoryStream(linkData))
            {
                var stream = new StreamWrapper(buffer);
                data.Load(stream);
            }
            var link = (IShellLink)data;

            link.Resolve(OwnerHwnd, SLR_FLAGS.SLR_UPDATE);
            return(link);
        }