notepad: New files should be created immediately.

This commit is contained in:
Sebastian Lackner 2015-08-25 06:57:58 +02:00 committed by Alexandre Julliard
parent 5bf1423c2c
commit 8a73016819
1 changed files with 9 additions and 0 deletions

View File

@ -702,9 +702,18 @@ static void HandleCommandLine(LPWSTR cmdline)
{
switch (AlertFileDoesNotExist(file_name)) {
case IDYES:
{
HANDLE file;
SetFileNameAndEncoding(file_name, ENCODING_ANSI);
file = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
UpdateWindowCaption();
break;
}
case IDNO:
break;