Salut à tous

Voilà je vous detail mon probleme:

L'utilisateur clique sur un bouton de Surpervision et ça execute mon appli si elle etait en arrière plan elle viens en premier plan
si elle n'existe pas elle se s'ouvre n'ormalement

et je voudrais que si elle est en en arrière plan au moment du click de la Surpervision actualiser des champs TdateTime.
j'ai testé ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
initialization
  // prüfen ob Programm schon läuft
  mHandle := CreateMutex(nil, True, 'Kurve_kxz5t79');
  // Anwendung läuft bereits
  if GetLastError = ERROR_ALREADY_EXISTS then
    begin
     // MessageBox(0, 'Kurve laeuft bereits.', 'Programmstart verweigert.', 16);

      THauptBild1.AufrufenProgramm('ChargenDokumentation');  
      Halt(muHALT_ALLREADY_RUNS);
      Form1.DateTimePicker:=now;
    end;
et ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
program Kurve;
uses
  Forms,
  Windows,
  SysUtils,
  VSKDataBase in 'VSKDataBase.pas',
  Logger in 'Logger.pas',
  gfc in 'gfc.pas',
  Global in 'Global.pas',
  HmProcessusDuration in 'HmProcessusDuration.pas',
  Kurve_Rost in 'Kurve_Rost.pas' {Form_Kurve_Rost_Show},
  Tabelle_Rost in 'Tabelle_Rost.pas' {Form_Tabelle_Rost},
  LpRost in 'LpRost.pas',
  FormSuchenUnterTeilnummer in 'FormSuchenUnterTeilnummer.pas' {Form_SuchenUnterTeilnummer},
  FormStartBild in 'FormStartBild.pas' {Form_StartBild},
  FormSuchenUnterStoerung in 'FormSuchenUnterStoerung.pas' {Form_SuchenUnterStoerung},
  Login in 'Login.pas' {LoginForm},
  ParameterDiffusions in 'ParameterDiffusions.pas' {Form_ParameterDiffusions},
  KurveDiffusions in 'KurveDiffusions.pas' {Form_KurveDiffusions},
  DiffusionsRechnen in 'DiffusionsRechnen.pas',
  LpModelAnlage in 'LpModelAnlage.pas',
  KurveProzess in 'KurveProzess.pas' {FormKurveProzess},
  PopupRostKurve in 'PopupRostKurve.pas' {FormPopupRostKurve},
  reinit in 'reinit.pas',
  FormAnlage_Belegung in 'FormAnlage_Belegung.pas' {Form_AnlageBelegung},
  FormOfenbuch in 'FormOfenbuch.pas' {Form_Ofenbuch},
  HauptBild in 'HauptBild.pas' {HauptBild1},
  ShellAPI,
  advgrid in 'advgrid.pas';

{$R *.res}

begin


  //ReportMemoryLeaksOnShutdown := (DebugHook <> 0);
  if IsPrevInstance = 0 then  begin
    Application.Initialize;
    Application.CreateForm(THauptBild1, HauptBild1);
    Application.CreateForm(TFormPopupRostKurve, FormPopupRostKurve);
    Application.CreateForm(TForm_Kurve_Rost_Show, Form_Kurve_Rost_Show);
    Application.CreateForm(TForm_Tabelle_Rost, Form_Tabelle_Rost);
    Application.CreateForm(TForm_SuchenUnterTeilnummer, Form_SuchenUnterTeilnummer);
    Application.CreateForm(TForm_SuchenUnterStoerung, Form_SuchenUnterStoerung);
    Application.CreateForm(TLoginForm, LoginForm);
    Application.CreateForm(TForm_ParameterDiffusions, Form_ParameterDiffusions);
    Application.CreateForm(TForm_KurveDiffusions, Form_KurveDiffusions);
    Application.CreateForm(TFormKurveProzess, FormKurveProzess);
    Application.CreateForm(TForm_AnlageBelegung, Form_AnlageBelegung);
    Application.CreateForm(TForm_Ofenbuch, Form_Ofenbuch);
    Application.CreateForm(TForm_StartBild, Form_StartBild);
    Form_StartBild.ImageSprache1Click(nil);
    Application.Run;
  end
  else begin

     AfficherInstance(IsPrevInstance);
     
    //SendDataToPreviousInstance ;
    Form1.DateTimePicker:=now;
  end;

end.

mais ça plante car non assigné

Y a t'il un autre moyen de communiquer avec une appli (autre que les Messages vu que depuis la supervision je ne peut envoyer de Message)

Merci d'avance
Nicolas
Cdlt