Autor Beitrag
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Mo 04.04.05 08:47 
Ich weiss die überschrift ist nicht so toll aber mir fällt keine bessere ein irgendwie.

Es geht um folgendes, ich starte via diser Funktion
ausblenden volle Höhe Delphi-Quelltext
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:
function RunProcess(FileName: string; ShowCmd: DWORD; wait: Boolean; ProcID: PDWord): Longword;
var
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
begin
  FillChar(StartupInfo, SizeOf(StartupInfo), #0);
  StartupInfo.cb          := SizeOf(StartupInfo);
  StartupInfo.dwFlags     := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
  StartupInfo.wShowWindow := ShowCmd;
  if not CreateProcess(nil,
    @Filename[1],
    nil,
    nil,
    False, 
    CREATE_NEW_CONSOLE or
    NORMAL_PRIORITY_CLASS, 
    nil, 
    nil,
    StartupInfo, 
    ProcessInfo) 
    then
      Result := WAIT_FAILED 
  else 
  begin
    if wait = FALSE then 
    begin 
      if ProcID <> nil then ProcID^ := ProcessInfo.dwProcessId;
      exit; 
    end;
    WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, Result); 
  end; 
  if ProcessInfo.hProcess <> 0 then
    CloseHandle(ProcessInfo.hProcess); 
  if ProcessInfo.hThread <> 0 then 
    CloseHandle(ProcessInfo.hThread);
end;


aus meinem Programm ein neues anderes Programm und warte bis dieses wieder geschlossen wird. Jetzt tritt ab und zu, nicht immer, der Effekt auf dass das zweite Programm gestartet wird, man kurz die Maske sieht und dann die Form entweder einfach in der Systray als Button verschwindet (wie wenn man die Form minimiert), man sie nimmer aufmachen kann oder die Form ist zwar sichtbar aber nicht gezeichnet, sprich man sieht sie zwar aber mit leerem Inhalt, also würde kein neues Formpaint aufgerufen werden.

Dieser Effekt tritt auf bei XP-Rechnern, seltsamerweise aber nur bei sehr wenigen obwohl das IMAGE bei allen gleich ist, es scheint sich also um ein tieferes Windowsproblem zu sein. Kennt jemand ähnliche Fälle und vielleicht sogar noch eine Lösung dazu?

_________________
mfg. Joel
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Mo 04.04.05 09:29 
Hi,

probier mal testweise den Parameter STARTF_FORCEOFFFEEDBACK zu entfernen. :)

//Edit: Im übrigen würde ich dir empfehlen diesen Parameter:
ausblenden Quelltext
1:
LPCTSTR lpCurrentDirectory,  // pointer to current directory name					


schon mit anzugeben, sonst kann es dir mal passieren, daß der aufgerufene
Prozess im falschen Verzeichnis ausgeführt wird. (in dem Verzeichnis nämlich,
indem sich das Programm befindet, welches für das CreateProcess verantwortlich ist)

_________________
Stellen Sie sich bitte Zirkusmusik vor.