ZeroMemory(@wcex,sizeof(wcex));
with wcex
do
begin
cbSize := SizeOf(wcex);
style := CS_HREDRAW
or CS_VREDRAW
or CS_OWNDC;
lpfnWndProc := @wndproc;
hInstance := SysInit.HInstance;
hCursor := LoadCursor(0,IDC_ARROW);
lpszClassName := PChar(settings.sWindowClassName);
hbrBackground := 1;
end;
if RegisterClassEx(wcex) = 0
then
raise EREGISTERCLASSEX.create(
{$IFDEF DEBUG}'
RegisterClassEx(wcex) failed '+inttostr(getlasterror)+'
(GLE)'
{$ENDIF});
case settings.rResolution.rScreenMode
of // = smWINDOWEDREGULAR
smFSCRN:
;
smWINDOWEDREGULAR:
begin
dwExStyle:=WS_EX_APPWINDOW
or WS_EX_WINDOWEDGE;
dwStyle:=WS_OVERLAPPEDWINDOW
or WS_CLIPSIBLINGS
or WS_CLIPCHILDREN;
AdjustWindowRectEx(WindowRect,dwStyle,false,dwExStyle);
end;
smWINDOWEDNOBORDER:
;
smFSCRNWINDOWED:
;
end;
asm
int 3
// bis hierhin komme ich
end;
// mit F7 springt er dann weiter in die winapi.pas
_hWnd:=CreateWindowEx(dwExStyle,
PChar(settings.sWindowClassName),
PChar(settings.sWindowCaption),
dwStyle,
WindowRect.Left,
WindowRect.Top,
WindowRect.Width,
WindowRect.Bottom,
0,0,HInstance,
nil);
// bis hierhin kommt er nicht mehr, im debuglog von XE2 steht ein fehler siehe unten
if _hWnd = 0
then
raise ECREATEWND.create(
{$IFDEF DEBUG}'
CreateWindowEx failed '+inttostr(getlasterror)+'
(GLE)'
{$ENDIF});
ShowWindow(_hWnd, SW_SHOW);
SetForegroundWindow(_hWnd);
asm
int 3
end;