mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 17:26:22 +00:00
Handle notepad log feature.
This commit is contained in:
parent
216ae64f9d
commit
868a2b0466
|
@ -206,10 +206,12 @@ BOOL DoCloseFile(void)
|
||||||
|
|
||||||
void DoOpenFile(LPCWSTR szFileName)
|
void DoOpenFile(LPCWSTR szFileName)
|
||||||
{
|
{
|
||||||
|
static const WCHAR dotlog[] = { '.','L','O','G',0 };
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
LPSTR pTemp;
|
LPSTR pTemp;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
DWORD dwNumRead;
|
DWORD dwNumRead;
|
||||||
|
WCHAR log[5];
|
||||||
|
|
||||||
/* Close any files and prompt to save changes */
|
/* Close any files and prompt to save changes */
|
||||||
if (!DoCloseFile())
|
if (!DoCloseFile())
|
||||||
|
@ -267,6 +269,18 @@ void DoOpenFile(LPCWSTR szFileName)
|
||||||
SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
|
SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
|
||||||
SetFocus(Globals.hEdit);
|
SetFocus(Globals.hEdit);
|
||||||
|
|
||||||
|
/* If the file starts with .LOG, add a time/date at the end and set cursor after
|
||||||
|
* See http://support.microsoft.com/?kbid=260563
|
||||||
|
*/
|
||||||
|
if (GetWindowTextW(Globals.hEdit, log, sizeof(log)/sizeof(log[0])) && !lstrcmp(log, dotlog))
|
||||||
|
{
|
||||||
|
static const WCHAR lfW[] = { '\r','\n',0 };
|
||||||
|
SendMessage(Globals.hEdit, EM_SETSEL, GetWindowTextLength(Globals.hEdit), -1);
|
||||||
|
SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
|
||||||
|
DIALOG_EditTimeDate();
|
||||||
|
SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
|
||||||
|
}
|
||||||
|
|
||||||
SetFileName(szFileName);
|
SetFileName(szFileName);
|
||||||
UpdateWindowCaption();
|
UpdateWindowCaption();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue