Basic Window C Programming | Desktop Application GUI | WinMain CreateWindow WNDCLASS | DefWindowProc

preview_player
Показать описание
You want to write a basic windows application using C language and want to start your journey in the development. Stay tuned till the end and do not miss any part of this video.

What are Windows basic applications?
Windows came long way. In the beginning days of windows it used to come with basic minimal applications. Calculator, notepad and paint brush are the most popular ones.
These are small scale applications and they were written in C. However we can write these type of simple applications using Win32 APIs and C language.

What are basic steps we write in windows applications?

Define WinMain function.
Define a Custom Window Class.
Register the Window Class.
Create the registered window.
Show Window.
Update Window for drawing.
Infinite loop with GetMessage.
Dispatch messages to window procedure.
Return from #WinMain.

What is window class structure ?
Windows class structure, contains the window class attributes that will be registered by the RegisterClass function.
What is message structure ?
Message structure contains message information from a thread's message queue.
What all Win32 API functions we need to know?

#RegisterClass
#DefWindowProc
#CreateWindow
#ShowWindow
#UpdateWindow
#GetMessage
#DispatchMessage

Lets write our program
Open Visual Studio Code #visualstudiocode
Add windows header file
Define local variables
Define members of window class
Window style, window procedure, instance, mouse cursor, background brush color and name of the class
Register the window class
Create the window
Show window
Update window for paint or drawing
Get all the messages on this window from main thread
Dispatch those to window procedure
Return from Winmain on exit from message loop
Now lets compile the program.

Our program uses Windows APIs so it needs windows libraries.
Kernel32 user32 gdi32 libraries we have to add in the linking.
Lets test the application.

Here it goes. Now you have your own app.

Hope you like this tutorial. Help us to grow our channel. Please like and subscribe to our channel for watching these type of tutorial videos. Thanks once again and see you in the next video.
#cprogramming #cplusplusprogramming #win32api #visualstudio #windowsclasses #winmain
#createwindow #defwindowproc #basicwindow
GetMessage,
basic gui in,
basic gui in c++,
createwindow,
createwindow c++,
defwindowproc example,
dispatchmessage msdn,
first gui program,
first gui programming,
graphical user interface,
gui in c++ tutorial,
gui program,
gui program in c,
gui programming,
gui programming c++,
kernel32, user32,gdi32,
window class,
windows c programming,
windows gui in c++,
windows program in c,
winmain c++,
wndclass,
visual studio code,
run program in visual studio code,
win32 api tutorial,
visual studio,
win32 basic window with visual studio code
win32 basic window compile with libraries,
Desktop Application in C
Basic Desktop Application in C
Рекомендации по теме
Комментарии
Автор

Nice! As a programmer coming from other languages your tutorial is straight to the point (ain’t no patience for common tutorials out there that starts afresh from variable types and while loops 😂)

Knowing I can call explorer from cmd line is also a neat trick I take away from ur vid

So thanks keep up the good work

qwlol
Автор

bro can u put tutorial on windows.h from the baics

dongladson