CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2000
    Posts
    1

    How to show windows standard dialog

    I want to show windows standard dialog in my c++ Program,just like the "computer property tab dialog" or "add new device dialog".How to do it?


  2. #2
    Join Date
    May 1999
    Posts
    216

    Re: How to show windows standard dialog

    The standard dialog you mean is the contro panel dialog, I think.
    The system properties and device properties are system dialog.
    The control panel application(refer to MSDN Control Panel Applications)are the dll which have .cpl extension.
    YOu have to execute those dlls to view your dialog. To execute those dll you can use rundll32.exe. The code looks something similar.

    ShellExecute(NULL,"open","rundll32.exe","shell32.dll,Control_RunDLL Desk.cp1,,0);
    // note the two comma, it is not a single comma. it is 2(,,) and no comma between Control_RunDLL and desk.cpl
    This will open the desktop properties window.
    The zero(0) after the two commas is the page you want to open. If you want to open the first page you give 0(zero)first page means 1 and so on.
    All the cpl files will be located in the winnt\system32 directory.
    some aer located in the winnt directory also.
    Instead of desk.cpl give any cpl and it will open appropiate "standard" window.
    Hopes it helps you
    Note: if you have problem in the arguments check the registry key. it contains the arguments.
    HKEY_CLASSES_ROOT\cplfile\shell\cplopen\command



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

Featured