uses WinProcs, WinTypes, Win31, LEdit;
{$I LEDIT__S.INC}

var
  Msg: TMsg;
  Wnd: hWnd;

const
  Header: longint = longint(PChar(
'TXT/Header files/*.h/C++ source/*.cpp/Pascal source/*.pas/' +
'Text files/*.txt/All files/*.*'));

{ Main block }
begin
  { Create LEdit window - main window of the application }
  Wnd := CreateWindow('LEDit',
		      cmdLine,
		      WS_VSCROLL OR WS_HSCROLL OR WS_OVERLAPPEDWINDOW OR
		      ES_STANDALONE OR ES_CANCHANGEFONT OR ES_FILELOWER OR
		      ES_USESHORTNAME,
		      CW_USEDEFAULT, CW_USEDEFAULT,
		      CW_USEDEFAULT, CW_USEDEFAULT,
		      0, 0, hInstance, nil);

  if (Wnd <> 0) then
    begin

      { Change a little LEdit behaviour }
      SendMessage(Wnd,EM_SETFILEFILTER,0,Header);
      SendMessage(Wnd,EM_SETFONT,GetStockObject(DEVICE_DEFAULT_FONT),0);
      SendMessage(Wnd,EM_SETSYNTAX,0,1);
      Behaviour(Wnd);

      { Show window }
      ShowWindow(Wnd,SW_SHOW);

      { Run message loop }
      while ( IsWindow(Wnd) ) do
        begin
          GetMessage(Msg,0,0,0);
          TranslateMessage(Msg);
	  DispatchMessage(Msg);
        end;
    end;
end.