对话方块(六十五)

2010-12-30 21:13:56 · 作者: · 浏览: 41370
message)
{
case WM_INITDIALOG:
return TRUE ;

case WM_COMMAND:
switch (LOWORD (wParam))
{
case IDOK:
EndDialog (hDlg, 0) ;
return TRUE ;
}
break ;
}
return FALSE ;
}
 POPFILE.C
/*--------------------------------------------------------------------------
POPFILE.C -- Popup Editor File Functions
------------------------------------------------------------------------*/

#include <windows.h>
#include <commdlg.h>

static OPENFILENAME ofn ;
void PopFileInitialize (HWND hwnd)
{
static TCHAR szFilter[] = TEXT ("Text Files (*.TXT)\0*.txt\0") \
TEXT ("ASCII Files (*.ASC)\0*.asc\0") \
TEXT ("All Files (*.*)\0*.*\0\0") ;

ofn.lStructSize = sizeof (OPENFILENAME) ;
ofn.hwndOwner = hwnd ;
ofn.hInstance = NULL ;
ofn.lpstrFilter = szFilter ;
ofn.lpstrCustomFilter = NULL ;
ofn.nMaxCustFilter = 0 ;
ofn.nFilterIndex = 0 ;
ofn.lpstrFile = NULL ; // Set in Open and Close functions
ofn.nMaxFile = MAX_PATH ;
ofn.lpstrFileTitle = NULL ; // Set in Open and Close functions
ofn.nMaxFileTitle = MAX_PATH ;
ofn.lpstrInitialDir = NULL ;
ofn.lpstrTitle = NULL ;
of