hiding buttons and resizing of dialog

This is a discussion on hiding buttons and resizing of dialog within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I would like to hide and show buttons and resize my dialog box dynamically while the program is running. ...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    205

    hiding buttons and resizing of dialog

    Hi,
    I would like to hide and show buttons and resize my dialog box dynamically while the program is running. I have read the posts and using everywhere I see that using ShowWindow takes 2 parameters HWnd and ID but when I write ShowWindow in my program, it only allows me to use ID. I am kind of puzzled.
    BOOL CWnd::SHowWindow(int nCmdShow);

    I am guessing there must be another ShowWindow function from another class than CWnd that takes 2 parameters. Thanks for the help,
    Amish

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    There is a ShowWindow function which takes 2 arguments and a ShowWindow class method that, since it's a window class, doesn't need the window argument.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    but how to differentiate between the two. The showWindow function that takes two arguments must be from another class than CWnd. Any clue which class it's from
    Amish

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    It's a function, not a class method! And since they have different argument lists you can't possibly call the wrong one.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    ms vs 2005 does not allow me to call the function with 2 arguments. It says that this function only takes 1 argument
    Amish

  6. #6
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Put :: in front of the function name:
    Code:
    ::ShowWindow(Window, Flags);
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  7. #7
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    Thanks. it works now. Weird. so what does :: mean exactly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. resizing OpenGL picture control in MFC window
    By stanlvw in forum Windows Programming
    Replies: 1
    Last Post: 03-19-2009, 04:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21