Well, I know I'm maybe not ready for this, but I'm making efforts to try myself at it. Since yesterday I gathered pieces of snippets about creating windows and I found out a kind of library that handles windows and I want to be able to do that to be able to handle also the pixels in a window, because I'm able to do it all by myself, using SDL... So I checked in a 20000 lines of code header file and found out some things that might help me build a window.
I will look later to how to change the screen's pixels, but right now I'm only trying to "keep" a window. Though I fail... This is what I came up with, it sure is messed up, but when I run it I get a window that opens and closes in a flash, even if my program enters an infinite loop...
Code:
#include "windows.h"
static DWORD WINAPI _events_thread(void* arg) {
CLIENTCREATESTRUCT lpParam;
RECT rect;
rect.left = rect.top = 0;
rect.right = 480;
rect.bottom = 432;
AdjustWindowRect(&rect, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, false);
CreateWindowA("MDICLIENT", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT,
480, 432, 0, 0, 0, &lpParam);
return 0;
}
void main() {
HANDLE thread;
HANDLE created;
HANDLE mutex;
void *arg = 0;
unsigned long ThreadID;
mutex = CreateMutex(0, 0, 0);
created = CreateEvent(0, 0, 0, 0);
thread = CreateThread(0, 0, _events_thread, arg, 0, &ThreadID);
WaitForSingleObject(thread, INFINITE);
for (;;) {}
}
So I came up with this, but I got to mention, my project type is still in console, so I think I'd have to use WinMain() and change to a Window project, right?
Edit: I tried also "__stdcall WinMain(void) {" to change from "void main()", but I get an error telling me that I can't just overload that function... As if I was trying to redefine a previously defined function... What??