コード例 #1
0
ファイル: shortcutFile.cs プロジェクト: qmgindi/Au
 /// <summary>
 /// Releases internally used COM objects (IShellLink, IPersistFile).
 /// </summary>
 public void Dispose()
 {
     if (_isl != null)
     {
         Api.ReleaseComObject(_ipf); _ipf = null;
         Api.ReleaseComObject(_isl); _isl = null;
     }
 }
コード例 #2
0
ファイル: shortcutFile.cs プロジェクト: qmgindi/Au
        //This could be public, but then need to make IShellLink public. It is defined in a non-standard way. Never mind, it is not important.

        shortcutFile(string lnkPath, uint mode)
        {
            _isl     = new Api.ShellLink() as Api.IShellLink;
            _ipf     = _isl as Api.IPersistFile;
            _lnkPath = pathname.normalize(lnkPath);
            if (mode != Api.STGM_WRITE && (mode == Api.STGM_READ || filesystem.exists(_lnkPath).File))
            {
                AuException.ThrowIfHresultNot0(_ipf.Load(_lnkPath, mode), "*open");
                _isOpen = true;
            }
        }
コード例 #3
0
ファイル: AShortcutFile.cs プロジェクト: alexfordc/Au
        //This could be public, but then need to make IShellLink public. It is defined in a non-standard way. Never mind, it is not important.

        AShortcutFile(string lnkPath, uint mode)
        {
            _isl     = new Api.ShellLink() as Api.IShellLink;
            _ipf     = _isl as Api.IPersistFile;
            _lnkPath = lnkPath;
            if (mode != Api.STGM_WRITE && (mode == Api.STGM_READ || AFile.ExistsAsFile(_lnkPath)))
            {
                AuException.ThrowIfHresultNot0(_ipf.Load(_lnkPath, mode), "*open");
                _isOpen = true;
            }
        }