)
{
case IDOK:
file://取EDIT控件文本数据并写入control.ini文件
GetDlgItemText(hWnd,IDC_EDIT,
SlideText,sizeof(SlideText));
WritePrivateProfileString(szSection,
szEntry,SlideText,szIniFileName);
EndDialog(hWnd,TRUE);
return TRUE;
case IDCANCEL:
EndDialog(hWnd,FALSE);
return TRUE;
case IDABOUT:
file://调用ABOUT对话框
DialogBox(hMainInstance,
MAKEINTRESOURCE(DLG_ABOUT),
hWnd,(FARPROC)AboutDialog);
return TRUE;
}
break;
}
return FALSE;
}
BOOL WINAPI RegisterDialogClasses
(HINSTANCE hInstance)
{
return TRUE;
}
BOOL WINAPI AboutDialog
(HWND hWnd,UINT message,WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDOK:
EndDialog(hWnd,TRUE);
return TRUE;
}
break;
}
return FALSE;
}
最后,编译连接并将生成的MiniSaver.EXE更名为MiniSaver.SCR拷入WINDOWS目录。此时可以使用配置对话框了。