The Windows Functionality Suite (http://www.aaronballman.com/programming/REALbasic/Win32FunctionalitySuite.php) does a great job of bringing the app and window to the front and flashing the window and taskbar with a simple use of:
Window1.BringToFront

However once in front, the window then behaves like a global floater. That is, it stays on top of all other apps until closed.

Is there a way to bring the app and window to the front with or without The Windows Functionality Suite that doesn't have this drawback? A way to modify the code in WindowExtensions.BringToFront?

FYR, this is the code from WindowExtensions.BringToFront (v2.4)

Sub BringToFront(extends w as Window)
  Dim i, h, r As Integer

  #if TargetWin32
    if not w.visible then
      w.visible = true
    end if

Declare Function SetWindowPos Lib "User32" (hWnd As Integer, hWndInsertAfter As Integer, _ X As Integer, Y As Integer, cx As Integer, cy As Integer, wFlags As Integer) As Integer Declare Function ShowWindow Lib "User32" ( hWnd As Integer, nCmdShow As Integer ) As Integer Declare Function BringWindowToTop Lib "User32" ( hWnd As Integer ) As Integer Declare Function SetForegroundWindow Lib "User32" ( hWnd As Integer ) As Integer

    ' Get the Window Handle
    h = w.WinHWND
    r = &h1 + &h2 + &h40

    ' Activate the Window
    i = SetWindowPos( h,-1, 0,0,0,0, r )
    i = ShowWindow( h, 1 )
    i = BringWindowToTop( h )
    i = SetForegroundWindow( h )
    w.FlashWindowEx( 3 )
  #endif
End Sub


PS - A big thanks to Aaron for this indispensable set of tools.

RB2006r3
Win XP

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to