当前位置:网站首页>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;
}
边栏推荐
- Qt 信号在多层次对象间传递 多层嵌套类对象之间信号传递
- Win11大小写提示图标怎么关闭?Win11大小写提示图标的关闭方法
- 78. 子集
- Hello World driver (II) - primary version
- [Yuri crack man] brings you easy understanding - deep copy and shallow copy
- Swin Transformer【Backbone】
- What is the difference between heap memory and stack memory?
- Etcdv3 actual combat (III) -prevkv description and related operations
- How to correctly calculate the CPU utilization of kubernetes container
- 事半功倍:学会WEB性能测试用例设计模型
猜你喜欢

Course notes of single chip microcomputer principle and interface technology for migrant workers majoring in electronic information engineering

TCP experimental verification

Win11大小写提示图标怎么关闭?Win11大小写提示图标的关闭方法

复制列表时踩过的坑:浅拷贝与深拷贝

Opencv error: (parameter or structure field)) unrecognized or unsupported array type in functon 'cvgetmat‘

Oxycon 2022 network capture frontier conference is about to open!

QT notes - temporary floating window

Use eventlog analyzer for log forensics analysis

Unknown-Aware Object Detection:Learning What You Don’t Know from Videos in the Wild(CVPR 2022)

snownlp库各功能及用法
随机推荐
Oxycon 2022 network capture frontier conference is about to open!
图解LeetCode——5. 最长回文子串(难度:中等)
2022-07-21 group 4 polymorphism
Opencv 以指定格式保存图片
DDD落地的那叫一个高级
URDF 语法详解
Win11隐藏输入法状态栏方法
canvas——矩形的绘制——柱状图的制作
QT笔记——临时的悬浮窗口
[noip2001 popularization group] packing problem
Day 7 hcip notes sorting (OSPF configuration)
离线数据仓库从0到1-阶段二软件安装
Golang log programming system
Golang 中‘...‘的用法
爆肝出了4W字的Redis面试教程
STM32——DMA笔记
实现一个方法,找出数组中的第k大和第m大的数字相加之和
Canvas - drawing pictures - dynamic drawing production
Small test (I)
Canvas -- drawing of rectangle -- making of histogram