Results 1 to 5 of 5

Thread: BringWindowToTop Lib "user32" process handling... [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Resolved BringWindowToTop Lib "user32" process handling... [RESOLVED]

    I've been using API to bring a window to the foreground but it's not working if it's outside my app... uh, WHY?

    VB Code:
    1. Module modWindow
    2.     'Declare API Function
    3.     Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
    4.  
    5.     Public Sub SelectWindow(ByVal hwnd As Long)
    6.         'Bring target window to front
    7.         BringWindowToTop(hwnd)
    8.     End Sub
    9.  
    10.     Public Sub proTst(ByVal AppID As Integer)
    11.         Dim p As System.Diagnostics.Process
    12.         SelectWindow(Convert.ToInt32(p.GetProcessById(AppID).Handle))
    13.     End Sub
    14. End Module

    Not working... :s! But the API function works fine with let's say the handle of a form inside my app.... very odd...
    Last edited by Ruku; Nov 10th, 2005 at 01:48 PM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

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