vc++ api --dialog

来源:互联网 发布:Python自动将逗号转义 编辑:程序博客网 时间:2024/06/07 19:52

DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);

//hinstance,id,hwnd,wndproc

EndDialog(hDlg, LOWORD(wParam));

//hwnd,msgParam 

//(if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) EndDialog...)

CreateDialog(hInst,(LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);

//后面得接ShowWindow(hDlg,SW_SHOWNORMAL)来显示//对比DialogBox函数

CreateDialogIndirect(hInst,(LPDLGTEMPLATE)lpTemplate,hWnd,(DLGPROC)About);

MessageBoxEx(NULL,"内存不足","System Warning",MB_ICONHAND|MB_SYSTEMMODAL|MB_TOPMOST,0x0409) ;

MessageBoxIndirect(&mbp);//MSGBOXPARAMS mbp

hWnd=GetDlgItem(hDlg,IDOK);//根据父hwnd得到id的句柄

GetDlgCtrlID(hWnd)==IDOK//  根据句柄得到id

GetDlgItemText(hDlg,IDOK,szCaption,32);

SetDlgItemText(hDlg,IDOK,szCaption);

SetDlgItemInt(hDlg,IDOK,123,FALSE);

GetDlgItemInt(hDlg,IDOK,NULL,FALSE);

GetNextDlgTabItem(hDlg,NULL,FALSE);//!!!!!

MapDialogRect(hDlg,&rect);//!!!!!





0 0
原创粉丝点击