Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
it.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:
Windows Kernel
Development Platform:
Visual C++
- // $$ClassType$$IT.cpp : Implementation of C$$ClassType$$IT
- #include "stdafx.h"
- #include "InfoTipTest.h"
- #include "$$ClassType$$IT.h"
- #include "shlobj.h"
- /////////////////////////////////////////////////////////////////////////////
- // C$$ClassType$$IT
- // IPersist methods
- STDMETHODIMP C$$ClassType$$IT::GetClassID(CLSID *pclsid)
- {
- *pclsid = CLSID_$$ClassType$$IT;
- return NOERROR;
- }
- // IPersistFile methods
- STDMETHODIMP C$$ClassType$$IT::Load(LPCOLESTR pcwszFileName, DWORD dwMode)
- {
- lstrcpyW(_wszFileName, pcwszFileName);
- return NOERROR;
- }
- // IQueryInfo methods
- STDMETHODIMP C$$ClassType$$IT::GetInfoTip(DWORD dwFlags, WCHAR **ppwszTip)
- {
- IShellLink* psl;
- HRESULT hres;
- hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
- (void **)&psl);
- if(SUCCEEDED(hres))
- {
- IPersistFile* ppf;
- hres = psl->QueryInterface(IID_IPersistFile, (void**)&ppf);
- if (SUCCEEDED(hres))
- {
- hres = ppf->Load(_wszFileName, 0);
- if (SUCCEEDED(hres))
- {
- TCHAR szTarget[MAX_PATH];
- hres = psl->GetPath(szTarget, MAX_PATH, NULL, 0);
- if (SUCCEEDED(hres))
- {
- WCHAR* pwszOut = new WCHAR[MAX_PATH];
- if (!pwszOut)
- hres = E_OUTOFMEMORY;
- else
- {
- MultiByteToWideChar(CP_ACP, 0, szTarget, -1, pwszOut, MAX_PATH);
- *ppwszTip = pwszOut;
- // Caller will free pszOut
- }
- }
- }
- ppf->Release();
- }
- psl->Release();
- }
- return hres;
- }
- STDMETHODIMP C$$ClassType$$IT::GetInfoFlags(DWORD *pdwFlags)
- {
- *pdwFlags = 0;
- return NOERROR;
- }