Тёмный

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

Let's Understand
Подписаться 57
Просмотров 3,5 тыс.
50% 1

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

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@LenyoBlack
@LenyoBlack Месяц назад
So helpful
@Let-Us-Understand
@Let-Us-Understand Месяц назад
Glad you think so!
@qwlol
@qwlol 7 месяцев назад
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
@eliudbeyanga8575
@eliudbeyanga8575 2 месяца назад
A best teacher
@dongladson2771
@dongladson2771 Год назад
bro can u put tutorial on windows.h from the baics
@kcvinu
@kcvinu 2 месяца назад
Why would you need a tutorial about windows.h ? It's just a header file and you can get the info about almost all functions, structs, enums and constants from msdn. So forget windows.h, just focus on your task. Think what do you want to create with windows api functions. Then do some googling. You will get some function names and type names. Then search for them in msdn, you will find all the info you need to start the project. That's it.