windows shell program(3)
来源:互联网 发布:淘宝评价发图片 编辑:程序博客网 时间:2024/06/05 02:25
Drag and Drop
If you have read windows shell program(1), it will be easy. Only a reg script:
NoRemove Drive
{
NoRemove shellex
{
NoRemove DragDropHandlers
{
ForceRemove ......
}
}
}
NoRemove Directory
{
NoRemove shellex
{
NoRemove DragDropHandlers
{
ForceRemove ......
}
}
}
NoRemove Folder
{
NoRemove shellex
{
NoRemove DragDropHandlers
{
ForceRemove ........ }
}
}
OK, We can drop and drag now!
Shell PropPage Sheet
IShellExtInit is used to select some files as above.
IShellPropSheetExt is used to add or modify property sheet of files.
There are two methods in interface of IShellPropSheetExt:
STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE lpfnAddPageProc, LPARAM lParam);
STDMETHOD(ReplacePage)(UINT, LPFNADDPROPSHEETPAGE, LPARAM);
ReplacePage method only be used to extend the control panel's property page sheet .So, sometimes wo don't use it.
AddPages method parameters have a method pointer and a LPARAM variable.They all are used by shell.The lpfnAddpageProc points to inner function of shell proces to add pages. lParam is a very important value that is used by shell. Now we only talk about the lpfnAddpageProc.
In the AddPages function, there is a important Variable--PROPSHEETPAGE.
HRESULT CFileTimeShlExt::AddPages ( LPFNADDPROPSHEETPAGE lpfnAddPageProc, LPARAM lParam )
{
PROPSHEETPAGE psp;
TCHAR szPageTitle [MAX_PATH];
string_list::const_iterator it, itEnd;
for ( it = m_lsFiles.begin(), itEnd = m_lsFiles.end(); it != itEnd; it++ )
{
// 'it' 指向下一个文件名. 分配一个给页面使用的字符串拷贝.
LPCTSTR szFile = _tcsdup ( it->c_str() );
// 从文件名中截去路径和扩展名 – 用其作为页面标题. 该名称截取为 24 个字符以适合Tab的大小.
lstrcpy ( szPageTitle, it->c_str() );
PathStripPath ( szPageTitle );
PathRemoveExtension ( szPageTitle );
szPageTitle[24] = '/0';
psp.dwSize = sizeof(PROPSHEETPAGE);
psp.dwFlags = PSP_USEREFPARENT | PSP_USETITLE | PSP_DEFAULT | PSP_USEICONID | PSP_USECALLBACK;
psp.hInstance = _Module.GetModuleInstance();
psp.pszTemplate = MAKEINTRESOURCE(IDD_FILETIME_PROPPAGE);
psp.pszIcon = MAKEINTRESOURCE(IDI_ICON);
psp.pszTitle = szPageTitle;
psp.pfnDlgProc = PropPageDlgProc;
psp.lParam = (LPARAM) szFile;
psp.pfnCallback = PropPageCallbackProc;
psp.pcRefParent = (UINT*) &_Module.m_nLockCnt;
hPage = CreatePropertySheetPage ( &psp );
if ( NULL != hPage )
{
if ( !if ( NULL != hPage )
{
if ( !lpfnAddPageProc ( hPage, lParam ))
{ DestroyPropertySheetPage ( hPage ); }
}
} // end for
return S_OK;
}( hPage, lParam ))
{ DestroyPropertySheetPage ( hPage ); }
}
} // end for
return S_OK;
}
- windows shell program(3)
- windows shell program(1)
- windows shell program(2)
- windows bat shell program
- Shell Program
- shell program
- Shell program with C#
- ubuntu shell program
- linux shell program summary
- shell program 1
- shell script : stop program
- java、windows Program
- windows 程序设计 System Metrics Display Program No. 3
- Windows Program Automatic Startup Locations
- Development hadoop program on Windows
- Windows服务之Service Program
- OpenGL Program In Windows (一)
- The K Shell Program Guide(1)
- 编译Root Filesystem step by step
- C#开发COM组件
- QuickTest Professional中虚拟对象设置
- 标题:[转]追女人必须了解的24条短信
- ISO9000、CMM(I)、6sigma与对象分析技术
- windows shell program(3)
- 关于Win32程序的基本原理
- AJAX指南----操作XML
- Struts标签大全(转自CSDN的thinkpadleo专栏)
- 断言
- 识别动网验证码和CSDN验证码的思路
- GIF动画验证码
- 从一个string 里面搜索一个或几个chars
- 峰均比和Cliping在扩频通信系统的作用和意义