#include "ledit.h"

static MSG Msg;
static LONG Header = (LONG)
"TXT/Header files/*.h/C++ source/*.cpp/Pascal source/*.pas/\
Text files/*.txt/All files/*.*";

// Main Windows function
#pragma argsused
int PASCAL WinMain (HINSTANCE hInstance,
		    HINSTANCE hPrevInst,
		    LPSTR     lpszCmdLine,
		    int       nCmdShow)

{
  // To ensure static loading of LEDIT.DLL
  LVer();

  // Create LEdit window - main window of the application
  HWND Wnd = CreateWindow(LEDIT_CLASS,
    		  lpszCmdLine,
			  WS_VSCROLL | WS_HSCROLL | WS_OVERLAPPEDWINDOW |
			  ES_STANDALONE | ES_CANCHANGEFONT | ES_FILELOWER |
			  ES_USESHORTNAME,
			  CW_USEDEFAULT, CW_USEDEFAULT,
			  CW_USEDEFAULT, CW_USEDEFAULT,
			  0, 0, hInstance, NULL);
  if ( Wnd )
    {
      // Change a little LEdit behaviour
      SendMessage(Wnd,EM_SETFILEFILTER,0,Header);
      SendMessage(Wnd,EM_SETFONT,
        (WPARAM) GetStockObject(DEVICE_DEFAULT_FONT),0L);
      SendMessage(Wnd,EM_SETSYNTAX,0,1);
#include "ledit__s.inc"

      // Show window
      ShowWindow(Wnd,SW_SHOW);

      // Run message loop
      while ( IsWindow(Wnd) )
        {
          GetMessage(&Msg,0,0,0);
          TranslateMessage(&Msg);
	  DispatchMessage(&Msg);
        }
    }
return 0;
}