Disable button for print setup of the CPrintDialog
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Disable button for print setup of the CPrintDialog

  1. #1
    Join Date
    Oct 2008
    Posts
    4

    Disable button for print setup of the CPrintDialog

    Is there a way to disable the button that opens the printer setup? I just want to use default print settings so the printer setup is not necessary.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,067

    Re: Disable button for print setup of the CPrintDialog

    I haven't done it, but I would think deriving a class from CPrintDialog and then disabling the setup button inside OnInitDialog should work.

  3. #3
    Join Date
    Oct 2008
    Posts
    4

    Re: Disable button for print setup of the CPrintDialog

    Thanks...
    I created a class derived from CPrintDialog but do you know how to access the setup button? Is there an Control-ID?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,067

    Re: Disable button for print setup of the CPrintDialog

    I think it's 1024

  5. #5
    Join Date
    Oct 2008
    Posts
    4

    Re: Disable button for print setup of the CPrintDialog

    It is not 1024. I used this ID with GetDlgItem(...) but the pointer returned is 0.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,067

    Re: Disable button for print setup of the CPrintDialog

    Quote Originally Posted by MrNyquist View Post
    It is not 1024. I used this ID with GetDlgItem(...) but the pointer returned is 0.
    Then open the common DLL in your resource editor, find the dialog you're looking using and check the ID of the button you want.

  7. #7
    Join Date
    Oct 2008
    Posts
    4

    Smile Re: Disable button for print setup of the CPrintDialog

    Thanks...I did it in that way now and all works! By the way the control id is 1025.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center