//////////////////////////////////////////
// TreeView.cpp
//Copyright (c) 01/07/2003 by BCCSkelton
//////////////////////////////////////////
#include	"TreeView.h"
#include	"TreeViewProc.h"

////////////////
// WinMain関数
////////////////
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
					LPSTR lpCmdLine, int nCmdShow) {

	//２重起動防止
	if(!TreeView.IsOnlyOne()) {
		HWND hWnd = FindWindow("MainWnd", "TreeView");
		if(IsIconic(hWnd))
			ShowWindow(hWnd, SW_RESTORE);
		SetForegroundWindow(hWnd);
		return 0L;
	}

	//ウィンドウ登録 − Init(ClassName, hInstance, WndProc, "IDM_MAIN",
	//						（以下省略可）MAKEINTRESOURCE(IDI_ICON), IDC_ARROW, Brush)
	TreeView.Init("MainWnd", hInstance, SDIPROC, "IDM_MAIN",
					MAKEINTRESOURCE(IDI_ICON), IDC_ARROW, (HBRUSH)(COLOR_BTNFACE + 1));

	//ウィンドウ作成と表示−Create(WindowTitle, (以下省略可）Style,
	//						ExStyle, hParent, hMenu, x, y, w, h)
	if(!TreeView.Create("TreeView"))
		return 0L;

	//メッセージループに入る
	return TreeView.Loop();
}
