|
-
Mar 11th, 2001, 05:00 PM
#1
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
-
Mar 11th, 2001, 05:20 PM
#2
Monday Morning Lunatic
Code:
If App.PrevInstance Then
ActivateApp "My App"
End If
...or something like that
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 11th, 2001, 10:24 PM
#3
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
-
Mar 11th, 2001, 10:31 PM
#4
PowerPoster
Just activate your current prog and call an event handler
Last edited by Lethal; Mar 11th, 2001 at 10:34 PM.
-
Mar 11th, 2001, 11:01 PM
#5
PowerPoster
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...)
-
Mar 11th, 2001, 11:25 PM
#6
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
-
Mar 12th, 2001, 08:54 AM
#7
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
-
Mar 12th, 2001, 09:54 AM
#8
-
Mar 12th, 2001, 10:11 AM
#9
Thank you very much... I will take a look at it... and see what i can do
Andrew
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|