Autor Beitrag
sango
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 236

WinXP Home
Delphi 2005 Pro
BeitragVerfasst: Do 09.06.05 00:03 
Hi,

ich habe ein Problem mit meinem Screensaver. Er läuft gut, alles wunderbar, nur krieg ich die vorschau nicht hin.
ich habe bereits die gängigen tutorials durchsucht, und beachtet, jedoch egal welches ich versuchte, ich bekomms nicht hin.
hier der source der preview fenster:
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:
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:
unit preview;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Registry, ShellApi, jpeg, ExtCtrls;
type
  TForm4 = class(TForm)
    Image1: TImage;
  protected
    procedure CreateParams(var Params : TCreateParams);override;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;
  gParentHWND : Integer=0;
implementation

{$R *.dfm}
procedure TForm4.CreateParams(var Params: TCreateParams);
var rect  : TRect;
begin

  inherited;
  with Params do begin
    Caption  :='SCREENSAVER_PREVIEW';
    {$IFNDEF DEBUG}
    Style    :=Style or WS_CHILD or WS_CLIPCHILDREN;
    {$ELSE}
    Style    :=Style or WS_CLIPCHILDREN;
    {$ENDIF}
    ExStyle  :=0;
  end;

  if ParamCount>1 then begin
    try
      gParentHWND:=StrToIntDef(ParamStr(2),0);
    except;
      // ???
    end;
  end;

  if gParentHWND<>0 then begin
    Windows.SetParent(Handle,gParentHWND);
  end;

  if gParentHWND<>0 then begin
    GetWindowRect(gParentHWND,rect);

  with rect do begin
      SetBounds(0,0,Right-Left+1,Bottom-Top+1);
    end;
  end;
  inherited;

end;

end.


vielleicht kann mir da einen nen tritt in die richtige richtung geben.

thnx.