Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#7

Re: Wizardfenster vergisst das Zeichnen

  Alt 5. Sep 2008, 08:06
Hi,

Ok dann poste ich jetzt mal meinen Code. Wobei der quasi fast der Gleiche ist wie in dem anderen Thread.

RC:

Delphi-Quellcode:
#define DS_SHELLFONT (DS_FIXEDSYS | DS_SETFONT)

100 DIALOG DISCARDABLE 0, 0, 317, 143
STYLE WS_CHILD | WS_CAPTION | WS_DISABLED | DS_SHELLFONT
CAPTION "Dialog I"
FONT 8, "MS Sans Serif"
BEGIN
    
END

200 DIALOG DISCARDABLE 0, 0, 317, 143
STYLE WS_CHILD | WS_CAPTION | WS_DISABLED | DS_SHELLFONT
CAPTION "Dialog II"
FONT 8, "MS Sans Serif"
BEGIN
    
END
Delphi-Quellcode:

uses CommCtrl_Fragment;
// bzw
const
  PSH_WIZARD97 = $01000000;

// WizardProc1 + 2 (1=2 im Moment)
function WizardProc(Wnd: HWnd; Msg: Integer; WParam: WParam; LParam: LParam): Boolean; stdcall;
begin
  Result := true;
  // + oben genannte Versuche das Fenster neu zu zeichnen z.B.:
  case Msg of
    WM_NOTIFY:
    begin
      case PNMHdr(LParam)^.code of // oder nur wnd
       PSN_SETACTIVE: SetWindowPos(GetParent(wnd),HWND_TOP,0,0,0,0,SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW);
      end;
    end;
  end;
  // Das ist nur ein Beispiel aber die anderen wären auch (irgendwo) da zu finden. In den Aufrufen dürfte kein Fehler sein.
end;

procedure TForm1.Button1Click(Sender: TObject);
var psp1: TPropSheetpage;
    ps: TPropSheetHeader;
    pages: Array[0..1] of Pointer;
begin
  ZeroMemory(@psp1,0);
  psp1.dwSize := SizeOf(TPropSheetpage);
  psp1.dwFlags := PSP_DEFAULT;
  psp1.hInstance := hInstance;
  psp1.pfnDlgProc := @WizardProc;
  psp1.pszTemplate := MakeIntResource(100);
  pages[0] := CreatePropertySheetPage(psp1);

  psp1.pfnDlgProc := @WizardProc2;
  psp1.pszTemplate := MakeIntResource(200);
  pages[1] := CreatePropertySheetPage(psp1);

  ZeroMemory(@ps,0);
  ps.dwSize := SizeOf(TPropsheetHeader);
  ps.dwFlags := PSH_WIZARD97 or PSH_HEADER;
  ps.hInstance := hInstance;
  ps.hwndParent := Handle;
  ps.phpage := @pages[0];
  ps.nPages := Length(pages);
  ps.nStartPage := 0;

  PropertySheet(ps);
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat