Shell Extension:进入“重命名模式"对于一个新文件 [英] Shell Extension: enter "rename mode" for a new file
本文介绍了Shell Extension:进入“重命名模式"对于一个新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于具有类似于"New/[file type]"的UI的Windows Explorer shell扩展,我正在寻找一种可能为输入的文件自动设置重命名模式的方法.
使用上下文菜单处理程序并使用默认名称创建目标文件可以很好地工作.但是,我不知道如何以编程方式进入重命名模式.
(除了发送击键.您不想建议发送击键,对吗?)
For a Windows Explorer shell extension that has a UI similar to "New / [file type]", i am looking for a possibility to automatically ente rename mode for the file being created.
Context menu handler and creating the intended file with a default name works fine. However, I have no idea how to programmatically enter rename mode.
(except sending keystrokes. You didn''t want to recommend sending keystrokes, did you?)
推荐答案
注册您的函数/模块以更改文件名:
HKEY_CLASSES_ROOT\.<YourExtension>\ShellNew\command = <YourEXE> or <RUNDLL32.dll <YourDLL>, <YourDLLFunction>> "%1"
Register your function/module to change the filename:
HKEY_CLASSES_ROOT\.<YourExtension>\ShellNew\command = <YourEXE> or <RUNDLL32.dll <YourDLL>, <YourDLLFunction>> "%1"
// modify file new exe
const char* CreateANewFileName(const char* old,char* buffnew,unsigned int buffsize)
{
// do anything
return buffnew;
}
int FAR PASCAL WinMain(HINSTANCE,HINSTANCE,char* filename,int)
{
char newfile[0x1000];
if(filename && *filename)
{
MoveFile(filename,CreateANewFileName(filename,newfile,sizeof(newfile)));
}
return 0;
}
问候.
在文件名的位置创建一个编辑控件(作为窗口),然后在操作后重命名该文件.
Create an edit control (as window) on the place of the file name and then rename the file after your operation.
这篇关于Shell Extension:进入“重命名模式"对于一个新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文