Big problem with GetOpenFileName().

This is a discussion on Big problem with GetOpenFileName(). within the Windows Programming forums, part of the Platform Specific Boards category; You where right anonytmouse. I set ofn.hwndOwner to null to seperate it from my main window, and the problem is ...

  1. #16
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,534
    You where right anonytmouse. I set ofn.hwndOwner to null to seperate it from my main window, and the problem is no more.

    Thanks for the help.

    So what would I have to do to prevent that, while keeping my hwnd the parent?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #17
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,534
    Changing
    Code:
          case WM_PAINT:
          {
             BeginPaint(hwnd, &ps);
             BitBlt(ps.hdc, 0, 0, nWndWide, nWndHigh, hdcBuffer, 0, 0, SRCCOPY);
             EndPaint(hwnd, &ps);
             break;
          }
    to
    Code:
          case WM_PAINT:
          {
             BeginPaint(hwnd, &ps);
             BitBlt(ps.hdc, 0, 0, nWndWide, nWndHigh, hdcBuffer, 0, 0, SRCCOPY);
             EndPaint(hwnd, &ps);
             return 0;
          }
    works like I guessed, but is this a bad idea to do?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  3. #18
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    From MSDN:
    Quote Originally Posted by MSDN
    An application returns zero if it processes this message.
    With "break" you are returning whatever value is in the return statement at the end of your window proc, whereas with "return 0" you are explicitly returning 0 right then and there. Since WM_PAINT says to do this, I'd go with the second one, but really, I believe your window proc should be returning 0 anyways, so if its not, thats another problem you might want to look into.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. big number problem
    By mad_muppet in forum C Programming
    Replies: 11
    Last Post: 08-26-2008, 12:54 AM
  2. big endian-small endian problem
    By kapil1089thekin in forum C Programming
    Replies: 3
    Last Post: 05-15-2008, 06:47 PM
  3. Plzzzzz Help Me >>> Big Problem
    By AHMED KHALAF in forum C Programming
    Replies: 2
    Last Post: 12-09-2004, 06:31 AM
  4. [Help] C++ Problem
    By Oxide in forum C++ Programming
    Replies: 3
    Last Post: 10-09-2004, 09:05 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM

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