Click here to Skip to main content
12,817,112 members (34,524 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows 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?)
Posted 8-Jun-11 6:01am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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)
	return 0;

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Create an edit control (as window) on the place of the file name and then rename the file after your operation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 9 Jun 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100