You create the dialog in the dialog editor and then use the DialogBox function to show the dialog. You also need to write a DlgProc for the dialog and pass it's name to DialogBox.
Printable View
You create the dialog in the dialog editor and then use the DialogBox function to show the dialog. You also need to write a DlgProc for the dialog and pass it's name to DialogBox.
Juz some add on infor,
DialogBox will create a modal dialog and close the dialog with EndDialog(hDlg, LOWORD(wParam));
CreateDialog will create a modaless dialog and close the dialog with DestroyWindow (hDlg);
:)
Just to clear this up... I have NO experience with windows programming in C++. I don't know how to make windows or anything. I just want to learn how to create a window that I can draw on or print text to. Is the dialog what I want? I saw Vlatko's tutorial type post, and I used that code to create a window, but I didn't know what to do with it. I couldn't even figure out how to change the background color.
Well since you dont want to use MFC you have to do that manually. I can tell you are a VB person. I do not want this to sound rude, but once you start doing this it will make you C/C++ life better. STOP THINKING IN VB
Nothing you do in C/C++ from a window stand point is as easy as VB was. You have to do many things yourself. A good example is a button on your window. Its not like VB where you just plop a button down, set your code and be done. In C/C++ (with some exceptions MFC, dialogs, etc) you have to code in your button, you can't just draw it.
Example:
Then you have to catch the window message for when the button is clicked and have it fire off the function, code, or whatever you want it to do.PHP Code://Create Run Button
g_hWnd_RunButton = CreateWindow("Button", "Run", BS_PUSHBUTTON | WS_CHILD, 152, 1, 75, 35, g_m_hWnd, (HMENU)ID_RUNCLICK, g_m_hInst, NULL);
Example:
At first it is going to seem really hard, but once you get the basics down it will start to click. Then it will get a whole lot easier for you.PHP Code:switch(message)
{
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case ID_RUNCLICK: //Run Button Click
{
SENDMSG("Started Running .");
ClientRefresh(); //Refresh The Client Just Encase
Oh and here are some great tutorials. You might want to start with the C++, then move up to the VC++.
Tutorials
The thing is, I already know C++. I had an AP class last year and we learned all the basics like Arrays and pointers, etc. I can make console programs pretty decent, but you can't really do much with a console program. I want to convert this one program I made from VB to C++ so that it is smaller and easier to distribute to people without the VB runtimes. Thanks for that link to those tutorials. I'll have a look at them. :)