Sorry, the server has a flatrate at about 100/10 MBit/s, it's sometimes hard to reach it
You need three or four settings, depending on what you intend to do (the following names are guessed, since Lazarus starts up in German here even though I want it in English
):
* Settings -> Environment Settings -> Compiler -> C:\Apps\lazarus\pp\bin\arm-wince\ppcrossarm.exe (I think you did this as the proper compiler was showing up)
* Project -> Compiler settings -> Paths -> LCL interface -> wince (only if you use the LCL)
* Project -> Compiler settings -> Source code -> Target platform -> Target OS -> WinCE
* Project -> Compiler settings -> Source code -> Target platform -> Target processor -> arm
It's probably the later two or three settings that are still missing, because I remember that message when switching between Win32 and WinCE and forgetting those
What I meant by my own GUI framework is that I did not use Lazarus' GUI designer and an application of type Application, but a simple "Program", and wrote the event loop and control creation myself. That way, my apps are 3 MB, and after using strip, less than 1 MB, and I could implement a better fitting fullscreen mode.
I'll show you a very rough example (haven't really extracted that into a fully functional demo file yet):
Here's the main loop:
while GetMessage(@msgMain,0,0,0) do begin
TranslateMessage(@msgMain);
DispatchMessage(@msgMain);
end;
The event handler:
function WndMessageProc(hWnd: HWND; Msg: UINT; wParam: wPARAM; lParam: LPARAM): LongInt; stdcall;
var win: TMiniAppWindow;
iIndex: integer;
lw,hw: Word;
begin
Result := 0;
win := nil;
for iIndex := 0 to Pred(Length(MessageProcHandles))
do if MessageProcHandles[iIndex]=hWnd
then win := MessageProcWindows[iIndex];
case Msg of
WM_CREATE: begin
if Assigned(win)
then win.DoCreate;
end;
WM_ACTIVATE: begin
if Assigned(win)
then win.DoActivate(Lo(wParam),Hi(wParam),lParam);
end;
WM_DESTROY: begin
PostQuitMessage(0);
end;
WM_CLOSE: ;
WM_NOTIFY: begin
if Assigned(win)
then win.DoNotify(wParam, PNMHDR(lParam));
end;
WM_SETTINGCHANGE: begin
if Assigned(win)
then win.DoSettingChange(wParam, PMiniChar(lParam));
end;
WM_NCCALCSIZE: begin
if Assigned(win)
then win.DoCalcSize;
end;
WM_COMMAND: begin
lw := Lo(wParam);
hw := Hi(wParam);
if lw=IDOK then PostQuitMessage(0);
if Assigned(win) then begin
if lw>0
then win.DoMenu(hw,lw);
if lParam>0
then win.DoCommand(lParam);
end;
end;
end;
Result := DefWindowProc(hWnd,Msg,wParam,lParam);
end;
And the creation of the main window:
var FWindowClass: TWndClass;
FClassName: AnsiString;
FWindowTitle: WideString;
dwExStyle: DWord;
begin
FClassName := 'mytestappwindow';
FWindowTitle := 'My test app';
FWindowClass.hInstance := hInstance;
with FWindowClass do begin
style := 0;
hIcon := LoadIcon(hInstance,'MAINICON');
lpfnWndProc := TWndMessageProc(@WndMessageProc);
hbrBackground := COLOR_BTNFACE;
lpszClassName := PWideChar((FClassName));
cbClsExtra := 0;
cbWndExtra := 0;
{$IFDEF Win32}
hCursor := LoadCursor(0,IDC_ARROW);
lpszMenuName := '';
{$ENDIF Win32}
end;
RegisterClass(FWindowClass);
dwExStyle := WS_EX_NODRAG or WS_EX_NOANIMATION or WS_EX_CAPTIONOKBTN;
FHandle := CreateWindowEx(dwExStyle, FWindowClass.lpszClassName,
PWideChar(FWindowTitle), FWindowStyle,
Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), 0, 0, hInstance, nil);
if Handle = 0 then begin
MessageBox(0, 'Could not create test app window!', 'Test app', MB_OK);
UnRegisterClass(FWindowClass.lpszClassName, hInstance);
Exit;
end;
Add your controls using further CreateWindowEx calls, add events by associating the resulting handles with procedures and reacting on the window message handler.
Maybe I should create the complete example at all now that I've extracted the important parts anyway, will then post it on the blog