An example of this is with ICQ...
If you already have the application running, when run the application again it just makes itself active, instead of creating a new process...
Anyone know how I can do this?
Andrew
Printable View
An example of this is with ICQ...
If you already have the application running, when run the application again it just makes itself active, instead of creating a new process...
Anyone know how I can do this?
Andrew
...or something like that :)Code:If App.PrevInstance Then
ActivateApp "My App"
End If
Thank you... that helps to answer my question... although it brings up another question...
How can I instruct the current process to do something... like activating an event of a command button or something...
Andrew
Just activate your current prog and call an event handler
This will have a better result ;)
Code:Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private xhwnd As Long
Public Sub Main()
Dim xAppName As String
If App.PrevInstance Then
xAppName = "1 Instances For the Application"
xhwnd = FindWindow(0&, xAppName)
If xhwnd <> 0 Then
AppActivate xAppName
xhwnd = ShowWindow(xhwnd, SW_SHOWNORMAL)
End
End If
End If
Load frmMain
frmMain.Show
End Sub
'Code improved by vBulletin Tool (Save as...)
How can I instruct the application being activated to perform a task... Say executing an event...
Ive been lookin at DDE but how to go about that is something Id rather not do... for now...
If there is an easier way I would appreciate the help...
Andrew
Does anyone have an info that could help?
I know its possible but the best way to go about doing it is what I am looking for.
Andrew
amac, here is the sample program for DDE communication between 2 application.
Hope it can help you too. :)
Thank you very much... I will take a look at it... and see what i can do
Andrew