English
Forum

Mehrfachaufruf of their own Program prevent

 

Michael
Wodrich
I find whom Snippet simply not any more.

How verhindere I, that my Program multiple in memory standing.
with FindWindow and hWnd-comparison works it not at me.

After erfolgreichem Test should The ongoing instance activate go.

Why is To this Topic really in both Forums nothing to find?
 
Programmieren, das spannendste Detektivspiel der Welt.
09/07/06  
 




Michael
Wodrich
I see, half-way hour for Flüchtigkeitsfehler verbraten...

see code-Snippets

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
09/07/06  
 



Äh, haste whom now what found?
For this takes one mostly Mutex or Semaphore. FindWindow is To dodgy,
because it could the incorrect Window found go
 
09/07/06  
 




Michael
Wodrich
Siehste and under Mutex Have so did i not yet into Forums sought. thanks, there I will certainly fündig.

I wanted to just the ODoku.exe Window on a instance limit. there the cover very long is, becomes it for well suffice...

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
09/07/06  
 



the Simplest:
CompileMarkSeparation
 $U pipe.pcu = pipe.
declare pipe&
case pipe.is("odoku") : end
pipe&:=pipe.create("odoku")
waitinput
pipe.close 
 
09/07/06  
 



Hello Michael
here one Code Thomas Hölzer
CompileMarkSeparation
PRFellow- Vorlage
Autor: Thomas Hölzer
Die Prozedur OnlyOne sorgt dafür, daß nur eine Instanz eines
Profan²- 32 Bit(!)-Programms aufgerufen werden kann.
Sie muß als erste beim Programmstart abgearbeitet werden
Am Programmende muß CloseHandle aufgerufen werden!
declare programm$, version$
programm$="ADRESSOR "
version$="1.5.0"
Globale Deklarationen
Def CreateMutex(3) !"KERNEL32","CreateMutexA"
Def GetLastError(0) !"KERNEL32","GetLastError"
Def CloseHandle(1) !"KERNEL32","CloseHandle"
Declare MutexName#,Mutex&

Proc OnlyOne

    Declare error&,name$
    Let name$=programm$  Ein beliebiger,unverwechselbarer Name
    Dim MutexName#,Add(Len(name$),1)
    String MutexName#,0=name$
    Let Mutex&=CreateMutex(0,1,Mutexname#)
    Let error&=GetLastError()
    Dispose MutexName#

    If And(Neq(Mutex&,0),Equ(error&,0))

        MessageBox("Dies ist die erste Programminstanz
        Lassen Sie zum Testen diese
        Messagebox stehen und starten Sie das Programm noch einmal!","Mutex-Test",64)

    Else

        MessageBox("Das Programm ist schon aktiv  ",programm$+version$,16)
        CloseHandle(Mutex&)
        End

    EndIf

EndProc

Beispiel
OnlyOne
Die nächste Anweisung immer ans reguläre Progammende!!!
case mutex&: CloseHandle(Mutex&) PRFellow- Vorlage
Autor: Thomas Hölzer

have You, the sought ?
 
09/07/06  
 



[quote:1f0db0e676]Why editierst You then your Posting not? gruebel[/quote:1f0db0e676]
Hello iF
The question was reasonable what about me have now first understands, that me the edit of my Posts possible is. can You me once more forgive
hope that now everything is correct
 
09/07/06  
 



[quote:0224cc50ff=Horst horn]Hello
The code is from slip twice copies been - Sorry [/quote:0224cc50ff]
Why editierst You then your Posting not?
 
09/07/06  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

903 Views

Untitledvor 0 min.
Peter Max Müller11/13/17

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie