修改窗口标题
HWND
用于获取窗口句柄;
SetWindowText(HWND,"标题")
形如:
HWND hnd = GetHWnd();
SetWindowText(hnd, "袁一琦好帅");
运行:
弹出对话框
MessageBox(HWND, "对话框内容", "对话框标题",MB_OKCANCEL)
形如:
MessageBox(hnd, "你好,太子!", "提示",MB_OKCANCEL);
运行:
注:MessageBox有返回值;
返回值就可以判断点击的是确定还是取消;
形如:
int isok = MessageBox(hnd, "你好,太子!", "提示",MB_OKCANCEL);
if (isok == IDOK)
{
printf("你点击了OK\n");
}
else if (IDCANCEL == isok)
{
printf("你点击了取消\n");
}
运行: