Windows permissions

Started by
3 comments, last by sakky 21 years, 1 month ago
How would one find if there were more then one instances of an application running? Is there a sequence were an application needs to request permission from Windows before it can be instantiated? If so, is it controllable? How would one find out if another instance of there application is trying to run, and then close it out immediately? This should be done programmatically of course, but how?
Take back the internet with the most awsome browser around, FireFox
Advertisement
quote:Original post by sakky
How would one find if there were more then one instances of an application running?

Use the toolhelp functions on newer versions of windows and psapi on NT4. If the program itself needs to know if other instances of itself are running, use a mutex.

quote:Original post by sakky
Is there a sequence were an application needs to request permission from Windows before it can be instantiated? If so, is it controllable?

A different terminology is used with Windows.

quote:Original post by sakky
How would one find out if another instance of there application is trying to run, and then close it out immediately? This should be done programmatically of course, but how?


google: single instance mutex

"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
I need this for Internet Explorer. I need to find out if there is another instance of IE running. When it requests permission from windows to be created I want it to be denied. I also need to know how I can read &#106avascript in webpages prior to IE reading them then if there safe to go ahead and load them. This is for a popup blocker.
Take back the internet with the most awsome browser around, FireFox
What I do, which is probably the worst way to do it, but it worked for my needs was just make sure that I used a unique class name for the app, and before the I register the class for the app, I use the FindWindow function to make sure that the class has not been registered before. If it was, then kill that instance of the program, if it wasn''t, then keep running.
"...."
Rather than going through all that trouble to accomplish very little, why not simply write a proxy program like Proximitron. You configure IE (or whatever your browser you have) to use a proxy server on 127.0.0.1:8000 (or any other free port of your choosing), then have your program act as a proxy on that port (forwarding and filtering data from port X to port 80, and vice versa). In this way you can control exactly what IE (or any other browser) sees and what IE can tell. Since it is highly configurable you might even be able to use Proximitron to do what you want.

This topic is closed to new replies.

Advertisement