Thread: Dialog box

  1. #1
    Sanity is for the weak! beene's Avatar
    Join Date
    Jul 2006
    Posts
    321

    Dialog box

    Hi
    I was wondering on how to create a text editor dialog box (like opening a file)
    I know how to create normal dialog boxes, but i would like to use this one, for my project, thanks in advance!

  2. #2
    Sanity is for the weak! beene's Avatar
    Join Date
    Jul 2006
    Posts
    321
    i have the code, all i want to do is link it with the open button. so when i click it, the dialog box appears, i want to do this because as soon as i run the program, the dialog box appears.
    Last edited by beene; 10-21-2006 at 05:31 AM.

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Respond to a BN_CLICKED notification which is sent to the button's parent in the form of a WM_COMMAND message. There are many examples of how to do this on this board but here it is again anyway:
    Code:
    case WM_COMMAND:
      {
      HWND hCntrl;
      WORD wID,wNotify;
      
      hCntrl=(HWND)lParam;
      wID=LOWORD(wParam);
      wNotify=HIWORD(wParam);
      
      if (hCntrl)
        {
        /*notification is from a control*/
        if (wNotify==BN_CLICKED)
          {
          /*the notification is a result of a button click*/
          if (wID==identifier_of_your_button
            {
            /*button click came from button with id of 
            identifier_of_your_button*/
            }
          }
        }
      }
    where identifier_of_your_button is, unsurprisingly, the identifier of your button control.

    Since you seem to be doing a lot with controls just now, msdn: Windows Controls should be of considerable use to you. Please take the time to study the sections on the controls you are currently using: buttons, edits, toolbars, statusbars.

    I expect the msdn: common dialogs will prove useful, too.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    Sanity is for the weak! beene's Avatar
    Join Date
    Jul 2006
    Posts
    321
    thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Parent of a BrowseForFolder dialog box
    By @nthony in forum Windows Programming
    Replies: 4
    Last Post: 01-08-2007, 02:54 PM
  3. Display Dialog Box Then Execute
    By stickman in forum C++ Programming
    Replies: 17
    Last Post: 05-10-2006, 11:02 AM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM