对话方块(六十九)

2010-12-30 21:13:56 · 作者: · 浏览: 41364
text, write the
// byte order mark to the file.

#ifdef UNICODE
WriteFile (hFile, &wByteOrderMark, 2, &dwBytesWritten, NULL) ;
#endif
// Get the edit buffer and write that out to the file.
GetWindowText (hwndEdit, pstrBuffer, iLength + 1) ;
WriteFile (hFile, pstrBuffer, iLength * sizeof (TCHAR),
&dwBytesWritten, NULL) ;
if ((iLength * sizeof (TCHAR)) != (int) dwBytesWritten)
{
CloseHandle (hFile) ;
free (pstrBuffer) ;
return FALSE ;
}

CloseHandle (hFile) ;
free (pstrBuffer) ;

return TRUE ;
}
 POPFIND.C
/*--------------------------------------------------------------------------
POPFIND.C -- Popup Editor Search and Replace Functions
------------------------------------------------------------------------*/

#include <windows.h>
#include <commdlg.h>
#include <tchar.h> // for _tcsstr (strstr for Unicode & non-Unicode)

#define MAX_STRING_LEN 256

static TCHAR szFindText [MAX_STRING_LEN] ;
static TCHAR szReplText [MAX_STRING_LEN] ;

HWND PopFindFindDlg (HWND hwnd)
{
static FINDREPLACE fr ; // must be static for modeless dialog!!!

fr.lStructSize = sizeof (FIN