	function AutoRedrawOff(hEditWnd)
	{
	  AkelPad.SendMessage(hEditWnd, 11 /*WM_SETREDRAW*/, false, 0);
	}



	function AutoRedrawOn(hEditWnd) 
	{ 
		AkelPad.SendMessage(hEditWnd, 11 /*WM_SETREDRAW*/, true, 0); 
		AkelPad.SystemFunction().Call("user32::InvalidateRect", hEditWnd, 0, true); 
//		var oFunction = AkelPad.SystemFunction(); 
//		oFunction.Call("user32::InvalidateRect", hEditWnd, 0, true); 
	}



	function GetCaretOffset()
	{
		var lpIndex;
		var nOffset=-1;
		hEditWnd=AkelPad.GetEditWnd();

		if (lpIndex=AkelPad.MemAlloc(12 /*sizeof(AECHARINDEX)*/))
		{
			AkelPad.SendMessage(hEditWnd, 3130 /*AEM_GETINDEX*/, 5 /*AEGI_CARETCHAR*/, lpIndex);
			nOffset=AkelPad.SendMessage(hEditWnd, 3136 /*AEM_INDEXTORICHOFFSET*/, 0, lpIndex);
			AkelPad.MemFree(lpIndex);
		}
		return nOffset;
	}



	function GetSelectedOrAll()
	{
		if (AkelPad.GetSelStart() == AkelPad.GetSelEnd())
			return AkelPad.GetTextRange(0, -1);
		else
			return AkelPad.GetSelText();
	}


	var hEditWnd=AkelPad.GetEditWnd();
	var hMainWnd=AkelPad.GetMainWnd();
