Results 1 to 4 of 4

Thread: how to set focus on some existing form?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15

    Red face

    Ok guys, here's my problem: I'm trying to set focus on some existing form (It already have some icon in the start menu bar...!) and bring it back to foreground while double-clicking on a tray icon. P.S: Don't tell me "use SetForegroundWindow", cause it don't works... In that case, the icon on the start menu bar only blink a few times, but form don't shows
    - Allied

  2. #2
    Lively Member
    Join Date
    Apr 2001
    Location
    Central NC
    Posts
    75
    Under 98 and 2000 there are restrictions on which processes may bring a given window to the foreground. If a process can't do it, the target window's icon in the task bar is flashed.


    Perhaps:

    Platform SDK: Windows User Interface

    OpenIcon

    The OpenIcon function restores a minimized (iconic) window to its previous size and position; it then activates the window.

    BOOL OpenIcon(
    HWND hWnd // handle to window
    );
    Parameters
    hWnd
    [in] Handle to the window to be restored and activated.
    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Remarks
    OpenIcon sends a WM_QUERYOPEN message to the given window.

    Requirements
    Windows NT/2000: Requires Windows NT 3.1 or later.
    Windows 95/98: Requires Windows 95 or later.
    Header: Declared in Winuser.h; include Windows.h.
    Library: Use User32.lib.

    See Also
    Windows Overview, Window Functions, CloseWindow, IsIconic, ShowWindow

    Built on Thursday, May 11, 2000Requirements
    Windows NT/2000: Requires Windows NT 3.1 or later.
    Windows 95/98: Requires Windows 95 or later.
    Header: Declared in Winuser.h; include Windows.h.
    Library: Use User32.lib.
    See Also
    Windows Overview, Window Functions, CloseWindow, IsIconic, ShowWindow

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15
    But... If ICQ... or simply the dialup connection icon (tray icon, when you're connected) can do it, why we can't? There's a way, for sure... I've tried witn OpenIcon but this function just do nothing...
    - Allied

  4. #4
    Lively Member
    Join Date
    Apr 2001
    Location
    Central NC
    Posts
    75
    That would indicate to me that the program is probably deliberately blocking the maximization, i.e., it makes itself iconic again unless it was reactivated the way it wants to be reactiviated (if at all).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width