how to make my code looks like any windows program? i mean i want to my code open just like any other windows program and no in the command prompt windows. i would like to runs the code in a windows with file, tool, option, etc.. this code below is an example from my book with some change i made it to learn how struct works . any thoughts. thanks
you actually can change the project to make it a non console app, like mutexe said, but you cant expect it to do anything worth while, unless you learn an api, such as win32, sfml, sdl, allegro, or openg
i understand it isnt practical but is it technically possible to write a gui as a console app? i mean if it isn't than what did the guys who wrote win32 use to write win32?
Ok some questions:
what are the different is both are written in C++?
what is the next step?
is there any simple program, some "hello world" but running in win32 api ? //please forgive my lack of knowledge!
While the srticle refers to Visual Studio, as it starts of with an empty project all the code will be equally usable with any other IDE which provides Windows SDK support (e.g. Code::Blocks, CodeLite, ...) Or even on the command line, if you're keen enough.
Note that while Windows API apps can be written in C++, the API itself is (or at least a lot of it is) actually C.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
TCHAR greeting[] = _T("Hello, World!");
switch (message)
{
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// Here your application is laid out.
// For this introduction, we just print out "Hello, World!"
// in the top left corner.
TextOut(hdc,
5, 5,
greeting, _tcslen(greeting));
// End application-specific layout section.
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
@MarketAnarchist: do you mean making your own graphics api? of course its possible, but why would you do it? its like wanting to make your own version of the stl? and no its not possible using what op was using. you would need to use more lower level stuff
your getting terms mixed up. consoles not a level of programming. its an interface. the code you write is the level. you get lower level by not using abstracted things like i/ostream or printf and instead using code that is closer to the hardware