吧务
level 11
松鼠qwe2
楼主
楼主刚从bilibili这个视频中学会的。原视频网址:https://www.bilibili.com/video/BV1Qb4y1o7u9?spm_id_from=333.788.videopod.episodes&vd_source=cd761caeb69c056102e56282c7535a53
是c语言代码。属于win32编程。代码比普通的控制台helloworld稍微复杂一些。不过由于原视频的代码编译后打开是错误提示对话框的helloworld,所以说我改进了一些。把视频中的源代码:
#include <windows.h>
int WinMain(HINSTANCE hIns,HINSTANCE hPreIns,LPSTR IpCmdLine,int nCmdShow){
MessageBox(NULL,"helloworld","information",MB_YESNOCANCEL|MB_ICONERROR);
return 0;
}
运行效果是这样的:

改进后的源代码如下:
#include <windows.h>
int WinMain(HINSTANCE hIns,HINSTANCE hPreIns,LPSTR IpCmdLine,int nCmdShow){
MessageBoxA(NULL,"helloworld","information",MB_OK|MB_ICONINFORMATION);
return 0;
}
运行效果:



在二楼,楼主会教大家怎么编写。
2026年07月01日 09点07分
1
是c语言代码。属于win32编程。代码比普通的控制台helloworld稍微复杂一些。不过由于原视频的代码编译后打开是错误提示对话框的helloworld,所以说我改进了一些。把视频中的源代码:
#include <windows.h>
int WinMain(HINSTANCE hIns,HINSTANCE hPreIns,LPSTR IpCmdLine,int nCmdShow){
MessageBox(NULL,"helloworld","information",MB_YESNOCANCEL|MB_ICONERROR);
return 0;
}
运行效果是这样的:

改进后的源代码如下:#include <windows.h>
int WinMain(HINSTANCE hIns,HINSTANCE hPreIns,LPSTR IpCmdLine,int nCmdShow){
MessageBoxA(NULL,"helloworld","information",MB_OK|MB_ICONINFORMATION);
return 0;
}
运行效果:



在二楼,楼主会教大家怎么编写。












