|
-
Jun 21st, 2000, 09:40 PM
#1
Thread Starter
Junior Member
if i have a program that hide her window...
now the user run another copy of her.
i don't want the other copy to run(thats i know how to do)
but i want that the hide window will know that the user try
to run another copy of her and respond...
somebody have and idea how i do it???
-
Jun 21st, 2000, 10:19 PM
#2
Addicted Member
If I correctly understand your post, you want only a single instance of the program to run at a time, no other copies running on the computer, check this vb-world tips section, I am positive there is something there about only one instance of your program.
-
Jun 21st, 2000, 10:29 PM
#3
Thread Starter
Junior Member
no ...
i mean that i want that the hide program to know when the user try to run another copy (how to prevent the other copy to run , this i know!).
but thanks anyway...
-
Jun 21st, 2000, 11:24 PM
#4
Addicted Member
I see, with the normal only run one thing, the copy thats new knows it's a second copy then closes, but the original copy will not know another has been opened. hmm, maybe a timmer checking the the classname, or a DDE session to tell the original copy before closing the new.
-
Jun 26th, 2000, 05:58 AM
#5
transcendental analytic
If "the other app" is yours, you may put a code that does it instead by itself:
Code:
if app.previnstance then unload me
Also it's preferable to put this in a sub main so you wont even need to load any forms
Code:
if app.previsntance then exit sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 26th, 2000, 06:04 AM
#6
Addicted Member
but he wants his currently opened program to detect the attempt to run a second copy.
-
Jun 26th, 2000, 06:48 AM
#7
transcendental analytic
Sorry i missunderstood, well you can check for the running window classname, using findwindow api, also if you don't have a window in that app you could enumerate the the processes
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 26th, 2000, 03:30 PM
#8
Thread Starter
Junior Member
i have a question...
i think i can do it like this:
when the prog start she write a file with her DC, when you run antoer copy it checks the app.previnstance and if it's True then he get the DC (from the file) of the run copy and just show it (if it hide...) or send it any other message and kill it self.
i try it...
-
Jun 26th, 2000, 03:34 PM
#9
Monday Morning Lunatic
I would suggest using the window handle (HWND) rather than the device context, as VB has a habit of reorganising those.
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
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
|