Question about C++
Ok, let me change my origional question slightly, how would I write a program, using C++, and all it does is dispalays a single bmp image (and closes once you hit enter)?
Assuming Windows, you would need to create a Windows application somehow, either directly or with a library as suggested above.
If you create a new project in Visual Studio and specify Windows Application in the create project wizard, that will give you a skeleton application that creates a window.
There is an API call called LoadImage that can give you a handle to a bitmap loaded from a file, and another one called StretchBlt that will let you draw the bitmap onto your window in the OnPaint handler.
To close on Enter, you'd need to add a WM_KEYDOWN or WM_KEYPRESS handler to the WndProc function that called PostMessage(Hw,WM_CLOSE,0,0).
If you create a new project in Visual Studio and specify Windows Application in the create project wizard, that will give you a skeleton application that creates a window.
There is an API call called LoadImage that can give you a handle to a bitmap loaded from a file, and another one called StretchBlt that will let you draw the bitmap onto your window in the OnPaint handler.
To close on Enter, you'd need to add a WM_KEYDOWN or WM_KEYPRESS handler to the WndProc function that called PostMessage(Hw,WM_CLOSE,0,0).
Hello
Writing Win32 apps with no console (the black window with white text) is a bit harder to understand if you're new to programming.
I suggest you don't learn this stuff until you are already a little advanced in C++.. a complete newbie in C++ might get discouraged by this.
now here are 2 Tutorials I found:
http://www.mdstud.chalmers.se/%7Emd7amag/code/wintut/
http://www.winprog.org/tutorial/
Remember, avoid Java like the plague (and C# for that matter :P) The pros stick with C++.. (I better run before they start flaming me :P LOL )
Writing Win32 apps with no console (the black window with white text) is a bit harder to understand if you're new to programming.
I suggest you don't learn this stuff until you are already a little advanced in C++.. a complete newbie in C++ might get discouraged by this.
now here are 2 Tutorials I found:
http://www.mdstud.chalmers.se/%7Emd7amag/code/wintut/
http://www.winprog.org/tutorial/
Remember, avoid Java like the plague (and C# for that matter :P) The pros stick with C++.. (I better run before they start flaming me :P LOL )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement