Results 1 to 5 of 5

Thread: SET FOCUS

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Question

    Hi there,
    Anyone knows how to make an application take focus?
    Thanks!
    Chicho

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    do you mean another application?

    if so, try appactivate()

    here's what the help file says:

    This example illustrates various uses of the AppActivate statement to activate an application window. The Shell statements assume the applications are in the paths specified.

    Dim MyAppID, ReturnValue
    AppActivate "Microsoft Word" ' Activate Microsoft
    ' Word.

    ' AppActivate can also use the return value of the Shell function.
    MyAppID = Shell("C:\WORD\WINWORD.EXE", 1) ' Run Microsoft Word.
    AppActivate MyAppID ' Activate Microsoft
    ' Word.

    ' You can also use the return value of the Shell function.
    ReturnValue = Shell("c:\EXCEL\EXCEL.EXE",1) ' Run Microsoft Excel.
    AppActivate ReturnValue ' Activate Microsoft
    ' Excel.
    Mark
    -------------------

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Smile

    Mark,
    I meant my application.
    I used appActivate and the application will start blinking
    on the TaskBar is there any way I can make it show? Ive tried me.show but it wont worked;
    Thanks!
    Chicho

  4. #4
    Member
    Join Date
    Sep 2000
    Posts
    46
    Try maximizing your application.

    something like applicationname.maximize

  5. #5
    Guest
    Try using the SetForegroundWindow api function.

    Code:
    Public Declare Function SetForegroundWindow _
    Lib "user32" (ByVal hwnd As Long) As Long
    
    Usage:
    
    SetForegroundWindow Me.hwnd

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