Results 1 to 6 of 6

Thread: Create Window

  1. #1

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    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);


  3. #3
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  4. #4
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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:
    PHP Code:
    //Create Run Button
        
    g_hWnd_RunButton CreateWindow("Button""Run"BS_PUSHBUTTON WS_CHILD15217535g_m_hWnd, (HMENU)ID_RUNCLICKg_m_hInstNULL); 
    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.

    Example:
    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 
    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.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  5. #5
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Oh and here are some great tutorials. You might want to start with the C++, then move up to the VC++.

    Tutorials
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  6. #6
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width