Thread: The Last Selected Window

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    3

    Unhappy The Last Selected Window

    I'm developing a program that allows you to open more than one window, it's basically a text editor, with multiple windows, within one main window. I'm trying to get the handle of the last window the user had selected, but it's prooving more difficult than first imagined.

    I thoguht i would be able to just store the handle in a global variable each time the window proecudre for the sub windows is called, and use this when i need it. But it doesn't seem to work, it just gives the handle for the last window the user opened, not the last one they had selected.

    Does anyone have any ideas?

    Thanks

  2. #2
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    In your window, process the WM_KILLFOCUS message. I'm really not sure, but I think that the lParam of this message is a handle to the window that the focus is being set on. But, I'm not sure about which param.

    If you just generally want to get a handle to a window, use the FindWindow function. Declared as:
    Code:
    HWND FindWindow(
      LPCTSTR lpClassName,  // class name
      LPCTSTR lpWindowName  // window name
    );
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM