Window Common Control Dlgs

This is a discussion on Window Common Control Dlgs within the Windows Programming forums, part of the Platform Specific Boards category; I am having trouble using the Common control dialogs. First, I am trying to use PrintDlg, but I do not ...

  1. #1
    Unregistered
    Guest

    Post Window Common Control Dlgs

    I am having trouble using the Common control dialogs.

    First, I am trying to use PrintDlg, but I do not understand how to use the DEVMODE and DEVNAMES strucutres. Each time I use them I get a message saying printer does not exists. How can I get the name of the printer?

    Second, I am trying to use the Find Replace Dialog. I have incountered several problems and was wondering if anyone had any sample code on how to use dialog. It seems whenever the mouse goes over the dialog I get an illegal error message.

    Thanks in advance for your help.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    591
    What compiler do you use?
    How to you create and open the dialog?

  3. #3
    Unregistered
    Guest
    I am using LCC-Win32 on Windows 98. I figured out the printing problem, but still am having trouble with the Find Replace Dialog. I am using the code that I got on MSDN.

    Code:

    FINDREPLACE fr; // common dialog box structure
    HWND hwnd; // owner window
    CHAR szFindWhat[80]; // buffer receiving string
    HWND hdlg = NULL; // handle to Find dialog box

    // Initialize FINDREPLACE
    ZeroMemory(&fr, sizeof(FINDREPLACE));
    fr.lStructSize = sizeof(FINDREPLACE);
    fr.hwndOwner = hwnd;
    fr.lpstrFindWhat = szFindWhat;
    fr.wFindWhatLen = 80;
    fr.Flags = 0;

    hdlg = FindText(&fr);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Catching tab or enter in an EDIT control in a regular window
    By Boksha in forum Windows Programming
    Replies: 0
    Last Post: 11-19-2005, 09:27 AM
  2. Retrieving the window handle of a window a control resides in
    By -leech- in forum Windows Programming
    Replies: 7
    Last Post: 08-09-2003, 08:55 AM
  3. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  4. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 09:01 PM
  5. Invoking MSWord
    By Donn in forum C Programming
    Replies: 21
    Last Post: 09-08-2001, 04:08 PM

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