Results 1 to 3 of 3

Thread: help me out pls

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33

    Unhappy help me out pls

    i need to show the running application if it is already running.For this i used
    app.PrevInstance and used showwindow.Show widow never worked to me.
    pls help me abt.
    Thankyou
    Gopal

  2. #2
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Put this code in a Form

    Code:
    Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    
    Private Sub Command1_Click() 
     If App.PrevInstance = True Then
      Let w& = FindWindow(vbNullString, "Form1") ' Replace Form1 with the caption of the App.
      BringWindowToTop w&
     End If
    End Sub
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Sub Main()
    2.   If App.PrevInstance Then
    3.     AppActivate "[i]Title of main form[/i]"
    4.     End
    5.   Else
    6.     frmMain.Show
    7.   End If
    8. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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