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
native.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++
- //
- // native.cpp in shelllib
- //
- // common Utility functions that need to be compiled for
- // both UNICODE and ANSI
- //
- #include "proj.h"
- #include <vdate.h>
- // get the name and flags of an absolute IDlist
- // in:
- // dwFlags SHGDN_ flags as hints to the name space GetDisplayNameOf() function
- //
- // in/out:
- // *pdwAttribs (optional) return flags
- STDAPI SHGetNameAndFlags(LPCITEMIDLIST pidl, DWORD dwFlags, LPTSTR pszName, UINT cchName, DWORD *pdwAttribs)
- {
- if (pszName)
- {
- VDATEINPUTBUF(pszName, TCHAR, cchName);
- *pszName = 0;
- }
- HRESULT hrInit = SHCoInitialize();
- IShellFolder *psf;
- LPCITEMIDLIST pidlLast;
- HRESULT hres = SHBindToIDListParent(pidl, IID_IShellFolder, (void **)&psf, &pidlLast);
- if (SUCCEEDED(hres))
- {
- if (pszName)
- {
- STRRET str;
- hres = psf->GetDisplayNameOf(pidlLast, dwFlags, &str);
- if (SUCCEEDED(hres))
- hres = StrRetToBuf(&str, pidlLast, pszName, cchName);
- }
- if (SUCCEEDED(hres) && pdwAttribs)
- {
- RIP(*pdwAttribs); // this is an in-out param
- hres = psf->GetAttributesOf(1, (LPCITEMIDLIST *)&pidlLast, pdwAttribs);
- }
- psf->Release();
- }
- SHCoUninitialize(hrInit);
- return hres;
- }
- STDAPI_(DWORD) GetUrlScheme(LPCTSTR pszUrl)
- {
- if(pszUrl)
- {
- PARSEDURL pu;
- pu.cbSize = SIZEOF(pu);
- if(SUCCEEDED(ParseURL(pszUrl, &pu)))
- return pu.nScheme;
- }
- return URL_SCHEME_INVALID;
- }