/*
	  $Id: DETextCtrl.cpp 25 2009-11-28 00:34:01Z krkim $ $Revision: 25 $
     $HeadURL: http://krkim-laptop/svn/DuruEdit/Src/DEEditDLL/DETextCtrl.cpp $
 */
  DbSel
  http://krkim-laptop/svn/DuruEdit/Src/DEEditDLL/DETextCtrl.cpp
1999 ~ 2000

1999 ~ 2000 ABCProject started.
2009/10/09  ABCWTL + SDK DLL Project Restart.
            ABCConvert MFC Project to KFC Platform with my KFC Library
            ABCRenewal and Rebuild all architecture.
            ABC----------------------------------------------------------
2010/03/20  ABCKRKIM   버그픽스:쓰레드에서 검색시 GetFocus NULL로 인한 캐럿위치 오작동.
            ABC        DE_BUGFIX_THREADSAFE_GETFOCUS_INPUT
            ABC        검색창,간편검색바에서 메인창 단축키 가능하게 함.
            ABC        F3등 다음찾기시 간편검색바에 포커스있으면 우선검색어로 사용하고
                     검색창이 떠있으면 현재 입력된 검색어로 사용하고 그것도 아니면 이전검색어로 검색함.
                     검색창에서 F3등시 찾았으면 본문에 포커스주고 못찾았으면 그대로 유지.
                     검색창에서 다음찾기 버튼으로 했을 경우는 찾았어도 포커스를 검색창에 그대로 유지하게 함.
#include "stdafx.h"
#include "DEStructs.h"
#include ".h"
#include "langs.h"
 AE
//////////////////////////////////////////////////////////////////////////////////////////////////
::()
{
	m_cf.arDBCSWidth=NULL;
	m_cf.pLine=NULL;
	m_cf.hBit=NULL;
	m_cf.Parser=NULL;
	m_cf.bFindSelect=FALSE;
	m_cf.ViewMode=TEXT_VIEW;
	m_cf.Bklogfont.lfHeight=-1;
	m_cf.bShowCursor=TRUE;

	::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT),sizeof(LOGFONT),&m_cf.logfont);
}

BOOL ::Create(int x,int y,int w,int h,DWORD style,UINT id,HWND hParent)
{
	DWORD dwStyle = style | WS_CLIPCHILDREN;//WS_SYSMENU | WS_VISIBLE | WS_MINIMIZEBOX | WS_CLIPCHILDREN;
	CreateEx(0,"",NULL, dwStyle/*WS_OVERLAPPEDWINDOW*/,
		/*CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,*/
		x,y,w,h,hParent,(HMENU)id,NULL);
	return TRUE;
}

//KFC >>
BOOL 검색 쓰레드 종료
::PreCreateWindow(CREATESTRUCT &cs)
{
	{	//make sure the default window class is registered
#if 0
		char *classname="XFCWndClass";
		WNDCLASSEX wcex;
		wcex.cbSize = sizeof (WNDCLASSEX);
		wcex.style = CS_HREDRAW | CS_VREDRAW;
		//m_wcex.lpfnWndProc = (WNDPROC) ::DefWindowProc;// default SDK window procedure:
		wcex.lpfnWndProc = (WNDPROC) ::XFCWndProc;// default SDK window procedure:
		wcex.cbClsExtra = 0;
		wcex.cbWndExtra = 0;
		wcex.hInstance = XFCGetInstanceHandle();           // owner of the class: mandatory
		wcex.hIcon = NULL;//LoadIcon (m_hInstance, classname);
		//wcex.hIcon = LoadIcon(XFCGetInstanceHandle(), (LPCTSTR)IDI_MAINICON);
		wcex.hIconSm = NULL;//LoadIcon (m_hInstance, "SMALL");
		wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
		//wcex.hbrBackground = (HBRUSH) COLOR_BTNFACE;//(COLOR_WINDOW+1) ; // optional
		wcex.hbrBackground	= (HBRUSH)(COLOR_BTNFACE+1);

		wcex.lpszMenuName = cs.lpszClass;
		wcex.lpszClassName = cs.lpszClass;   // mandatory

		RegisterWndClass(wcex);
		//cs.lpszClass = classname;
#endif
	}
	return KFCWnd::PreCreateWindow(cs);
}

void ::RegisterWndClass(WNDCLASSEX &wcex)
{
	wcex.hCursor = LoadCursor(NULL,IDC_IBEAM);//set default cursor shape here***********
	wcex.hbrBackground = NULL;//(HBRUSH)(COLOR_WINDOW+1);
	KFCWnd::RegisterWndClass(wcex);
}

///////////////////////////////////////////////////////////////////////////////////
// KFC Message Handler

BOOL ::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	HINSTANCE hInst = KFCGetInstanceHandle();

	m_cf.bComp=FALSE;
	m_cf.bCapture=FALSE;
	m_cf.bSelLine=FALSE;
	m_cf.SelStartLine=0;
	m_cf.bDragSel=FALSE;
	m_cf.SumDelta=0;
	m_cf.bHideCaret=FALSE;
#ifdef USE_SKINSCROLLBAR
	m_sbH.Create(WS_CHILD | WS_VISIBLE | SBS_HORZ,0,0,0,0,m_hWnd,AEID_HORZSCROLL);
	m_sbV.Create(WS_CHILD | WS_VISIBLE | SBS_VERT,0,0,0,0,m_hWnd,AEID_VERTSCROLL);

	CHAR szImageFile[_MAX_PATH];
	GetModuleFileName(NULL,szImageFile,sizeof(szImageFile));

	CHAR *p = strrchr(szImageFile,'\\');
	if(p) strcpy(p+1,"SkinBar.bmp");
	m_sbH.SetBitmap(szImageFile);
	m_sbV.SetBitmap(szImageFile);
	m_sbHorz = m_sbH.GetSafeHwnd();
	