WinMain
作者:互联网
一、入口函数
int WINAPI WinMain(
HINSTANCE hInstance, //应用程序当前实例的句柄(内存地址)
HINSTANCE hPrevInstance, //当前程序的先前实例的句柄。该参数总为NULL
LPSTR lpCmdLind, //命令行的字符串的指针
int nShowCmd) //窗口显示方式、默认为SW_SHOWDEFAULT
#include<windows.h>
#include<stdio.h>
#pragma comment( linker, "/subsystem:\"console\" /entry:\"WinMainCRTStartup\"")
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLind, int nShowCmd)
{
//程序实例句柄
printf("%p %p %p\n", hInstance, hPrevInstance, GetModuleHandle(NULL));
//程序命令行字符串
printf("%s\n", lpCmdLind);
//运用程序窗口的初始显示方式
printf("%d\n", nShowCmd);
MessageBox(NULL, L"hello", L"提示", MB_OK);
return 0;
}
标签:int,句柄,WinMain,hInstance,nShowCmd,HINSTANCE,NULL 来源: https://www.cnblogs.com/lnterpreter/p/14125433.html