Hmm, irgendwie schlägt er nicht an.
Mein Testprogrämmchen ( D7) :
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure AppMessage(
var Msg: TMsg;
var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.AppMessage(
var Msg: TMsg;
var Handled: Boolean);
begin
if Msg.
message = WM_DEVICECHANGE
then
begin
Label1.Caption := '
Wechsel';
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := AppMessage;
end;
end.