Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#8

Re: Password Generator

  Alt 19. Mai 2008, 17:42
Hilfe lsen bildet.

Zitat:
The UPDOWN_CLASS window class is registered when the common controls DLL is loaded. If you create an up-down control without using the CreateUpDownControl function, you must ensure that the DLL is loaded. You can do so by using the InitCommonControls function.
Delphi-Quellcode:
var
  {Fensterklasse}
  wc: TWndClassEx = (
    cbSize : SizeOf(TWndClassEx);
    Style : CS_HREDRAW or CS_VREDRAW;
    lpfnWndProc : @WndProc;
    cbClsExtra : 0;
    cbWndExtra : 0;
    hbrBackground : color_btnface + 1;
    lpszMenuName : nil;
    lpszClassName : ClassName;
    hIconSm : 0);
  msg: TMsg;

begin
  InitCommonControls; // <- benötigt für SpinEdit
  SetLastError(0);
  wc.hInstance := hInstance;
  wc.hIcon := LoadIcon(0, IDI_APPLICATION);
  wc.hCursor := LoadCursor(0, IDC_ARROW);

  {Fenster anmelden}
  RegisterClassEx(wc);
  Writeln(GetLastError);
  {Fenster erstellen}
  CreateWindowEx(0, ClassName, AppName, WS_CAPTION or WS_VISIBLE or WS_SYSMENU or WS_MINIMIZEBOX, 0, 0, WindowWidth, WindowHeight, 0, 0, hInstance, nil);
  // ...;
  // ...;
GetLastError war übrigens 2 (Datei ncht gefunden) nach RegisterCLassEx.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat