hi all,
i am trying to open up a window
i have coded out word for word from this youtube video
https://www.youtube.com/watch?v=8GCvZs55mEM&list=PLWzp0Bbyy_3i750dsUj7yq4JrPOIUR_NK&index=1
but i am getting errors, can anyone help
#include <windows.h>
LRESULT CALLBACK WindowProcedure(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
//MessageBox(NULL, "HELLO","My first GUI",MB_OK);
WNDCLASSEXW wc = {0};
wc.hbrBackground = (HBRUSH) COLOR_WINDOW ;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hInstance = hInst;
wc.lpszClassName = L"myWindowClass";
wc.lpfnWndProc = WindowProcedure;
if(!RegisterClassW(&wc));
return -1;
CreateWindowW(L"myWindowClass",L"My Window",WS_EX_OVERLAPPEDWINDOW | WS_VISIBLE,100,100,500,500,
NULL,NULL,NULL,NULL);
MSG msg = {0};
while( GetMessage(&msg,NULL,NULL,NULL) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK WindowProcedure(HWND HWND,UINT msg,WPARAM wp,LPARAM lp)
{
switch ( msg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProcW(HWND,msg,wp,lp);
}
}
Win32 API ( Windows GUI ) Programming with C++/C.
--Part 1--
Creating a basic empty windows from a windows class.
Part 2 : https://youtu.be/7K6HCeog09c
Facebook page :
https://www.facebook.com/pentamollis