summary C语言windows编程

https://mbd.baidu.com/newspage/data/landingshare?context=%7B%22nid%22%3A%22news_9628739996547396200%22%2C%22sourceFrom%22%3A%22bjh%22%2C%22url_data%22%3A%22bjhauthor%22%7D

建立C语言文件 --> 添加代码:


#include 

int WINAPI WinMain(

	HINSTANCE hInstance,

	HINSTANCE hPrevInstance,

	LPSTR lpCmdLine,

	int nCmdShow

) {

	// 调用API 函数MessageBox

	int nSelect = MessageBox(NULL, TEXT("hello"), TEXT("mention"), MB_OKCANCEL);

	if (nSelect == IDOK) {

		MessageBox(NULL, TEXT("you choosed yes"), TEXT("mention"), MB_OK);

	}
	else {

		MessageBox(NULL, TEXT("you choosed cancel"), TEXT("mention"), MB_OK);

	}

	return 0;

}

run:

summary C语言windows编程_第1张图片

点OK:

summary C语言windows编程_第2张图片

点cancel:

summary C语言windows编程_第3张图片

你可能感兴趣的:(总)