当前位置:网站首页>ELS register window class, create window class, display window
ELS register window class, create window class, display window
2022-07-26 03:15:00 【joker_ 0030】
#include<Windows.h>
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,LPSTR ipCmdLine,int nCmdShow)
{
// Initialize window class .
WNDCLASSEX db;//WNDCLASS An extension of .
HWND hWnd;
db.cbClsExtra = 0;
db.cbSize = sizeof(WNDCLASSEX);
db.cbWndExtra = 0;
db.hbrBackground = (HBRUSH)COLOR_WINDOW;
db.hCursor = NULL;
db.hIcon = NULL;
db.hIconSm = NULL;
db.hInstance = hInstance;
db.lpfnWndProc = NULL;
db.lpszClassName = "els";
db.lpszMenuName = NULL;
db.style = CS_HREDRAW | CS_VREDRAW;
// Register window class .
//ATOM//unsigned short type .
if(0==RegisterClassEx(&db));// Return to zero , Registration failed .
{// Something went wrong , I don't know what the mistake is .
int a = GetLastError();// The return value is 87, Through the tool -> Error finding can show that it is parameter error .
return 0;
}
// create a window .hWnd Window handle Failure to return NULL.
hWnd=CreateWindowEx(WS_EX_TOPMOST,"els","elsfangkuai",WS_OVERLAPPEDWINDOW,100,100,100,100,NULL,NULL,hInstance,NULL);
// The first parameter dwExStyle Specifies a style of the window .
// The second parameter lpClassName, The name of the window class , The system is visible .
// The third parameter lpWindowName , The name of the window , People can see it .
// Fourth parameter hWndParent , Parent window handle .
// Fifth parameter dwStyle , Specify the style of creating the window .
// Sixth parameter x,y , Specify the initial level of the window , Vertical position , Relative to the desktop .
// Seventh parameter nWidth,nHeight: The width and height of the window .hWndParent: Parent window handle , Not set to NULL.
// Eighth parameter hMenu Menu handle , If not, set it NULL.
// The ninth parameter hinstance: Current real column handle .
// The tenth parameter points to a pointer to a value , This value is passed to the window WM_CREATE news , This value is passed in IParam In the parameter CREATESTRUCT Structure transfer . If the application calls CreateWindow Create a MDI Customer window , be ipParam Must point to a CLIENTCREATESTRUCT structure ,MDI-- Multi document window style .
if (NULL == hWnd)// Window handle . Unique identification of the window .
{
return 0;
}
// Display window
ShowWindow(hWnd,nCmdShow);
// Return value : Visual return true, Hidden return false.
// Parameters 1: Window handle . Parameters 2: Specifies how the window is displayed , It can be for nCmdShow( The default is SW_SHOWNORAML).
return 0;
}
边栏推荐
- Implement a method to find the sum of the number k and m in the array
- 万维网、因特网和互联网的区别
- 2022-07-21 第四小组 修身课 学习笔记(every day)
- [noip2001 popularization group] packing problem
- canvas——绘制文本——饼图的修改
- Canvas - ECG design and how to clean the canvas
- ENVI_ Idl: create HDF5 file and write data (take writing GeoTIFF file to HDF file as an example) + detailed parsing
- JVM内存模型解析
- NFT因无意义而美丽
- STM32——串口学习笔记(一个字节、16位数据、字符串、数组)
猜你喜欢

YOLOv3: An Incremental Improvement

Win11 method of changing disk drive letter

Use eventlog analyzer for log forensics analysis

在混合云中管理数据库:八个关键注意事项

There are a group of students in the class who have got the test results in Chinese and mathematics. Please select the students whose total score is the first

Digital commerce cloud DMS dealer management system solution: DMS system realizes business Omni channel and sales data collection

JVM memory model parsing

如何正确计算 Kubernetes 容器 CPU 使用率

canvas——绘制文本——饼图的修改

Managing databases in a hybrid cloud: eight key considerations
随机推荐
els 注册窗口类、创建窗口类、显示窗口
Chen Yili, China Academy of communications technology: cost reduction and efficiency increase are the greatest value of Enterprise Cloud native applications
LeetCode·
万维网、因特网和互联网的区别
CMD CPM command summary
一篇文章让你理解 云原生 容器化相关
Jsd-2204-cool shark Mall (Management Commodity module) -day02
Opencv saves pictures in the specified format
JSD-2204-酷鲨商城(管理商品模块)-Day02
There are a group of students in the class who have got the test results in Chinese and mathematics. Please select the students whose total score is the first
STM32 - PWM learning notes
经典面试问题——OOP语言的三大特征
Opencv报错:(parameter or structure field))Unrecognized or unsupported array type in functon ‘cvGetMat‘
Qt 信号在多层次对象间传递 多层嵌套类对象之间信号传递
[Yuri crack man] brings you easy understanding - deep copy and shallow copy
Opening method of win11 microphone permission
Win11 hide input method status bar method
[sql] usage of self connection
【无标题】
2022-07-21 study notes of group 4 self-cultivation class (every day)