| muddaser (21) | |
| how to create simple window from application having simple out put displayed by a button? | |
|
|
|
| ajh32 (163) | |
| Are yoyu using Visual Studio? | |
|
|
|
| andywestken (1966) | |
|
If you're talking about a form application, as in an app using the .Net Forms Library, then it sounds like you're talking about a managed C++/CLI rather than a native (aka unmanaged) C++ app. Is this the case? Andy | |
|
|
|
| muddaser (21) | |
| i want to made a window form application having text boxes buttons and codes are written natively not CLI | |
|
|
|
| muddaser (21) | |
| i m using visul c++ 2008 | |
|
|
|
| freddie1 (847) | |||
|
Here's a basic program and it'll work in VC++ 2008 no problem. Actually, its from this link where I have a basic GUI tutorial ... http://www.jose.it-berater.org/smfforum/index.php?topic=3389.0
Before it will work, you need to know how to set up a native Win32 project in Visual Studio 2008. If you don't know how to do that post back. | |||
|
|
|||
| andywestken (1966) | |||||
|
@muddaser You're mixing the terminology up: you can have a native Windows app or a Windows Form app (which uses the .Net Forms library). There is no such thing as a "native Form application" So you want a native Windows application. freddie1's code is pretty much the standard "Hello world" of native Windows apps, plus a few message boxes. Except that: #1 WM_CREATE is called when the window is created, not at program startup (once for each instance of a window class) #2 the WM_CLOSE handler should not call PostQuitMessage, that should be called by the WM_DESTROY handler
#3 you need to add 1 to the color contant, for the background brush, to get the right value (just one of those things...) wc.hbrBackground = (HBRUSH)(COLOR_BTNSHADOW + 1); #4 You should restore the changes you make to the GDI DC in the WM_PAINT handler
And note that what you create with CreateWindowEx is a window, not a form (as the name of the functions tells us). Andy PS For a bit more info, see Creating Win32-Based Applications (C++) http://msdn.microsoft.com/en-us/library/bb384843.aspx | |||||
|
Last edited on
|
|||||