; CString str=BUF;
str.TrimRight();
if(str=="保存(&S)")//如果是保存按钮
{
lstrcpy(BUF,(LPCTSTR)sPath);//sPath表示我们要设置的对话框浏览目录
//发消息设置文件名EDIT为我们的路径名
pedit->SendMessage(WM_SETTEXT,0,(LPARAM)BUF);
//发消息模拟点击保存按钮
::SendMessage(pwnd->GetSafeHwnd(),WM_LBUTTONDOWN,0,0);
::SendMessage(pwnd->GetSafeHwnd(),WM_LBUTTONUP,0,0);
}
}
}
pwnd = pwnd->GetNextWindow();
}
pedit->SendMessage(WM_SETTEXT,0,(LPARAM)filename);//发消息还原EDIT里的文件名
delete buf;