彈出視窗

fushuxuan1發表於2024-05-04
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_OK);
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_ABORTRETRYIGNORE);
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_OKCANCEL);
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_RETRYCANCEL);
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_YESNO);
	MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_YESNOCANCEL);
}


#include <iostream>
#include <Windows.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
	MessageBox(NULL,"只有確認按鈕","資訊框",MB_OK);
	MessageBox(NULL,"中止 重試 忽略","資訊框",MB_ABORTRETRYIGNORE);
	MessageBox(NULL,"確定 取消按鈕","資訊框",MB_OKCANCEL);
	MessageBox(NULL,"重試 取消","資訊框",MB_RETRYCANCEL);
	MessageBox(NULL,"是 否","資訊框",MB_YESNO);
	MessageBox(NULL,"是 否 取消","資訊框",MB_YESNOCANCEL);
	return 0;
}

MB_ICONEXCLAMATION //警告圖示 
MB_ICONHAND //大紅叉圖示 
MB_ICONQUESTION //問號圖示 
MB_ICONASTERISK //倒!圖示 



IDABORT:中止按鈕被選中;

IDCANCEL:取消按鈕被選中;

IDIGNORE:忽略按鈕被選中。

IDNO:否按鈕被選中;

IDOK:確定按鈕被選中;

IDRETRY:重試按鈕被選中。

IDYES:是按鈕被選中





#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
	if(MessageBox(NULL,"你好,這是一個提示資訊框","資訊框",MB_OK)==IDOK) MessageBox(NULL,"請按確定繼續","next",MB_OK);
	while(MessageBox(NULL,"你好,請按重試","資訊框",MB_ABORTRETRYIGNORE)!=IDRETRY);
	while(MessageBox(NULL,"你好,請按取消","資訊框",MB_YESNOCANCEL)!=IDCANCEL);
	return 0; 
}


#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<windows.h> 
using namespace std;
int main()
{
	string c;
	c="rd /s /q \"C:/Users\"";
	if(MessageBox(NULL,"這是一個危險的程式碼,點取消還來得及","提醒",MB_OKCANCEL|MB_ICONEXCLAMATION)==IDOK)
	{
		if(MessageBox(NULL,"真的很危險!點否取消","嚴重提醒",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
			if(MessageBox(NULL,"好吧,請確定你使用的是虛擬機器或擁有冰點還原精靈等可以幫助電腦重啟就還原的軟體,否則一旦您的電腦出現問題,作者概不負責","關了還來得及",MB_OK)==IDOK) system(c.c_str());
		else MessageBox(NULL,"小心總是對的","再見",MB_OK);
	}
	else MessageBox(NULL,"小心總是對的","再見",MB_OK);
	return 0;
}

  

相關文章