Thread: Big problem with GetOpenFileName().

  1. #16
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    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?

  2. #17
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    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?

  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.

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, 07: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