Может я выразился неправильно ???
У меня есть окошко написанное на WinAPI - Windows окно...
вот код:
program WinAPI;
uses
Windows;
var
WindowClass: TWndClass;
Handle: THandle;
msg: TMsg;
wError : Word;
CurrentError : LongWord;
boolAppRun : Boolean;
const
cWindowClass = 'SimpleWindowClass';
cWindowName = 'SimpleWindowName';
function WindowProc(iHandle: THandle; iMSG: LongWord; wParam, lParam: LongInt): LongInt; stdcall;
begin
case iMSG of
WM_DESTROY: begin
PostQuitMessage(0);
WindowProc := 0;
Exit;
end;
end;
WindowProc := DefWindowProc(iHandle, iMSG, wParam, lParam);
end;
begin
boolAppRun := True;
with WindowClass do
begin
style := CS_VREDRAW or CS_HREDRAW;
lpfnWndProc := @WindowProc;
cbClsExtra := 0;
cbWndExtra := 0;
hInstance := hInstance;
hIcon := LoadIcon(hInstance, MakeIntResource(0));
hCursor := LoadCursor(0, IDC_ARROW);
hbrBackground := $000000;
lpszMenuName := nil;
lpszClassName := PChar(cWindowClass);
end;
wError := RegisterClass(WindowClass);
if wError = 0 then
begin
CurrentError := GetLastError;
boolAppRun := False;
end;
Handle := CreateWindowEx
(WS_EX_APPWINDOW,
PChar(cWindowClass),
PChar(cWindowName),
WS_OVERLAPPED,
10,
10,
450,
350,
0,
0,
hInstance,
nil);
if Handle = 0 then
begin
CurrentError := GetLastError;
UnregisterClass(WindowClass.lpszClassName, hInstance);
boolAppRun := False;
end;
ShowWindow(Handle, SW_SHOW);
SetActiveWindow(Handle);
UpdateWindow(Handle);
while boolAppRun do
begin
boolAppRun := GetMessage(msg, 0, 0, 0);
TranslateMessage(msg);
DispatchMessage(msg);
end;
DestroyWindow(Handle);
UnregisterClass(WindowClass.lpszClassName, hInstance);
end.
И у меня выводится два окна...одно Windows, второе консольно....
Как убрать консольное....
Компилятор FPC 2.0.0