首页
社区
课程
招聘
[求助]"VC6.0实现快捷方式中查找目标功能" 请问谁到编好的源码
发表于: 2007-4-12 11:35 6317

[求助]"VC6.0实现快捷方式中查找目标功能" 请问谁到编好的源码

qyc 活跃值
4
2007-4-12 11:35
6317
796K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6i4m8W2k6r3W2&6i4K6u0W2j5$3!0E0i4K6u0r3j5X3u0K6K9s2c8E0L8q4)9J5c8V1u0n7f1K6k6Q4x3V1k6H3k6h3c8A6P5e0j5%4z5o6W2Q4x3X3g2Z5N6r3@1`.

d45K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6h3g2F1k6i4c8Q4x3X3g2U0L8$3#2Q4x3X3g2U0L8W2)9J5c8X3q4J5N6r3W2U0L8r3g2Q4x3V1j5J5x3o6l9$3i4K6u0r3x3o6t1I4x3#2)9J5c8V1p5J5x3o6l9$3x3o6t1I4x3K6f1H3x3o6t1#2y4#2)9J5k6i4y4Z5N6r3#2D9

相关文章

几经测试老是没法编译,汗,谁要是有的帮帮我  谢谢了

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 236
活跃值: (104)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
好象有个API可以从快捷方式文件中取出指向的实际文件或路径,然后用 ShellExculte("Open", "explorer.exe", "/select, 文件名或路径", "", "", sw_show)
ShellExculte 好象记错了
2007-4-14 22:10
0
雪    币: 255
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
也许有启发:

' TargetOpen 1.0
' 15/10/2002
' by Mohamed H. Tawfiq(pulp) mhtawfiq@yifan.net
'
' this script opens the target folder of a shortcut/.lnk with the target itself highlighted/selected.

dim listfile,filename, target

Set listfile = WScript.Arguments

filename = listfile(0)

' Wscript.echo filename

dim fs,f
set fs=CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile(filename)

set WshShell = WScript.CreateObject("WScript.Shell")
set oShellLink = WshShell.CreateShortcut(filename)
target = oShellLink.TargetPath

' wscript.echo target

' tfolder = left(target, InStrRev(target, "\"))

' wscript.echo tfolder

WshShell.Run "%windir%\explorer.exe /select," & Chr(34) & target & Chr(34)

set f=nothing
set fs=nothing
2007-4-20 21:07
0
雪    币: 255
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
MS的代码:

  #include <windows.h>
   #include <shlobj.h>

   // GetLinkInfo() fills the filename and path buffer
   // with relevant information.
   // hWnd         - calling application's window handle.
   //
   // lpszLinkName - name of the link file passed into the function.
   //
   // lpszPath     - the buffer that receives the file's path name.
   //
   // lpszDescription - the buffer that receives the file's
   // description.
   HRESULT
   GetLinkInfo( HWND    hWnd,
                LPCTSTR lpszLinkName,
                LPSTR   lpszPath,
                LPSTR   lpszDescription)
   {

      HRESULT hres;
      IShellLink *pShLink;
      WIN32_FIND_DATA wfd;

   // Initialize the return parameters to null strings.
      *lpszPath = '\0';
      *lpszDescription = '\0';

   // Call CoCreateInstance to obtain the IShellLink
   // Interface pointer. This call fails if
   // CoInitialize is not called, so it is assumed that
   // CoInitialize has been called.
      hres = CoCreateInstance( &CLSID_ShellLink,
                               NULL,
                               CLSCTX_INPROC_SERVER,
                               &IID_IShellLink,
                               (LPVOID *)&pShLink );

      if (SUCCEEDED(hres))
      {
         IPersistFile *ppf;

   // The IShellLink Interface supports the IPersistFile
   // interface. Get an interface pointer to it.
         hres = pShLink->lpVtbl->QueryInterface(pShLink,
                                            &IID_IPersistFile,
                                            (LPVOID *)&ppf );
         if (SUCCEEDED(hres))
         {
            WORD wsz[MAX_PATH];

   // Convert the given link name string to a wide character string.
            MultiByteToWideChar( CP_ACP, 0,
                                 lpszLinkName,
                                 -1, wsz, MAX_PATH );
   // Load the file.
            hres = ppf->lpVtbl->Load(ppf, wsz, STGM_READ );
            if (SUCCEEDED(hres))
            {
   // Resolve the link by calling the Resolve() interface function.
   // This enables us to find the file the link points to even if
   // it has been moved or renamed.
               hres = pShLink->lpVtbl->Resolve(pShLink,  hWnd,
                                               SLR_ANY_MATCH | SLR_NO_UI);
               if (SUCCEEDED(hres))
               {
   // Get the path of the file the link points to.
                  hres = pShLink->lpVtbl->GetPath( pShLink, lpszPath,
                                               MAX_PATH,
                                               &wfd,
                                               SLGP_SHORTPATH );

   // Only get the description if we successfully got the path
   // (We can't return immediately because we need to release ppf &
   //  pShLink.)
                  if(SUCCEEDED(hres))
                  {
   // Get the description of the link.
                    hres = pShLink->lpVtbl->GetDescription(pShLink,
                                                         lpszDescription,
                                                         MAX_PATH );
                  }
               }
            }
            ppf->lpVtbl->Release(ppf);
         }
         pShLink->lpVtbl->Release(pShLink);
      }
      return hres;
   }
2007-4-20 21:10
0
雪    币: 1462
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
什么好象咯,有就有没就没.
2007-5-23 21:09
0
游客
登录 | 注册 方可回帖
返回