window focus

This is a discussion on window focus within the Windows Programming forums, part of the Platform Specific Boards category; how do i bring a certain window to the front? example: i have the game Solitaire running, Internet Explorer, and ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    67

    window focus

    how do i bring a certain window to the front? example: i have the game Solitaire running, Internet Explorer, and my program open. IE is infront. i want my program to be able to bring the Solitaire window to the front by itself.

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    9
    To bring a window to the foreground, use SetForegroundWindow:
    Code:
    HWND solitaire = FindWindow(NULL,"Solitaire");
    BOOL ret = SetForegroundWindow(solitaire);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 09:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 03:33 PM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 11:50 AM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM

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