Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

hi,

habt ihr die heissen tage alle gut überlebt?

ich will keine klagen hören!

:marine

zum thema:

ich habe ein programm und ich möchte das dieses programm nur einmal

gestartet werden kann. ok, öfter starten möchte ich es schon, aber immer

nur eimmal zur gleichen zeit.

jetzt die frage, wie stelle ich das am besten an. ich hab mir dazu schon mal

gedanken gemacht. das muss doch irgendwie mit einer prozess id zu machen

sein.

würde mich freuen, wnn mich jemand in die richtige richtung leiten könnte.

ciao TinTin

Hallo,

beim Borland Builder geht es so.


try
{
HANDLE MutexHandle = CreateMutex (NULL, TRUE, "ACMUTEX");
if (WaitForSingleObject(MutexHandle,0) != WAIT_TIMEOUT)
{
Application->Initialize();
Application->CreateForm(__classid(TFrmOptionen), &FrmOptionen);
Application->CreateForm(__classid(TFrmProtokoll), &FrmProtokoll);
Application->Run();
}
else
{
ShowMessage("Programm kann nur einmal gestartet werden!");
}
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
[/code]

Frank

bordsuche...

jaja, das versteht sich fast von selbst... nur muss man auch wissen wonach man

sucht, darum die frage.

ich werde mir mal diese CreateMutex() geschichte anschauen und danach suchen.

ich hoffe das geht auch mit dem vc++ 6.0.

danke für den tip...und ein rundes wochenende...

ciao TinTin

super, danke erstmal. bin aber noch nicht dazu

gekommen mich damit zu beschäftigen...

Ciao TinTin

  • 2 Wochen später...

hat zwar etwas gedauert, aber ich hab mich jetzt damit beschäftigt

und das sogar erfolgreich!!!

will mich nur für eure hilfe bedanken...

ciao TinTin

  • 2 Wochen später...

Für alle, die noch nicht dahintergestiegen sind:

Es muss auf jeden Fall bei VC++ 6 in der InitInstance-Funktion überprüft werden, ob das Programm schon gestartet wurde. Die InitInstance wird nämlich bei jedem Starten für jeden Instanz des Programmes ausgeführt.

Original geschrieben von ITSE

Es muss auf jeden Fall bei VC++ 6 in der InitInstance-Funktion überprüft werden, ob das Programm schon gestartet wurde. Die InitInstance wird nämlich bei jedem Starten für jeden Instanz des Programmes ausgeführt.

InitInstance (als überschriebene Memberfunktion einer von CWinApp abgeleiteten Klasse) gibt es nur bei MFC-Anwendungen. Die Prüfung muss auch nicht dort erfolgen. Es ist nur sinnvoll, weil man das Programm einfach und sicher beenden kann, indem man FALSE zurückgibt.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.