Open a window without libraries or premade headers

Literally just joined this forum five minutes ago, needed a community to learn c++ from. Before c++ I used game maker, and in many ways their the same (at least in terms of syntax). I get most of the basics of c++ and understand how keywords and what not work, i just have trouble using these to actually achieve anything outside of simple variable comparison in a console app. Anyways my question is a simple one. I would like to know how one opens a window (other than the standard dos prompt) in c++ without the use of a library (opengl, directx) or premade headers (windows.h). I know it would be easier to use these but I think it'd be better for me to understand how to do this from scratch. Not trying to reinvent the wheel just trying to understand it (the complex devices that wheels are).
Last edited on
You can't.

At the very minimum, you need the <windows.h> header to access the OS functions to create a window.

(BTW, the function to create a window is called CreateWindow(). Google it on MSDN.)

Good luck!
Well what is it specifically that the windows.h header does. I mean if i just want to open a window could i not remove other parts of it? Or does it only exist to open windows. When you consider all the other header files it includes its hard to believe that the only thing it does is open windows, I could be wrong though. I just want to keep things as simple as possible for now, and surely there are unnecessary functions and classes in the windows header.
It includes all the stuff (well, most of the stuff) that you need to program Win32. There is no legitimate reason to prune it any.

Just #include it, and use it. It doesn't introduce any unnecessary complexity to your programs.
There is no legitimate reason to prune it any.
It should be noted that this is because declaring functions, which is what including the header does, doesn't increase the code size. All the program has to do is call functions the OS has already loaded anyway.
I think what x1101x is trying to do is understand the actual function instead of calling the header file and just running the predefined functions that windows supplies us. Best sugestion is search google for CreateWindow() function and see if you can actually look at how the function works outside of that theres a reason we have acess to these funtions and for c++ take advantage of what has been supplied to you so you can concentrate on what hasnt
Topic archived. No new replies allowed.