Autor Beitrag
HawkLUED
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WinXP
Delphi 7 Enterprise, Delphi 2007
BeitragVerfasst: Do 09.06.05 08:20 
Hi zusammen,

habe folgendes Problem!

Habe eine Form in einer DLL, die über mein Hauptprogramm geladen und angezeigt wird! (nicht Modal). Innerhalb dieser DLL-Form öffne ich einen weiteren Dialog (nicht Modal)! Wenn ich nun in diesem Dialog die ALT-Taste betätige springt der Fokus über auf meine Hauptform! Beende ich dann das Programm gibts eine Exception!

Die Hauptform, sowie die DLL-Form haben Key Preview = true?

Wie kann ich verhindern, das das ALT zur Hauptform durchschlägt?? Hab bereits probiert, in der Hauptform das Key Preview auf False zu setzen, hilft aber nix!

Danke!

Gruß

Andreas

_________________
Wenn Debuggen der Vorgang ist, Fehler aus einem Programm auszubauen,
dann ist Programmieren der Vorgang, Fehler in ein Programm einzubauen !
Mottor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Do 09.06.05 11:26 
Alt generiert WM_SYSCOMMAND. Schauen Sie TWinControl.WMSysCommand() in Controls.pas.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
  TForm2 = class(TForm)
...
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

...
implementation
...

procedure TForm2.WMSysCommand(var Message: TWMSysCommand);
begin
  if (Message.CmdType and $FFF0 = SC_KEYMENU) and (Message.Key = 0)
    and (GetCapture = 0)  then
    Exit;
  inherited;
end;