//////////////////////////////////////////
// MSCompAss.cpp
//Copyright (c) 09/30/2022 by BCCSkelton
//////////////////////////////////////////
#include	"MSCompAss.h"
#include	"MSCompAssProc.h"

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

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

	//引数の有無でフラグを立てる
	if(*lpCmdLine)
		g_ByFile = TRUE;
	else
		g_ByFile = FALSE;

	//モードレスダイアログを作成Create(hParent, DlgName, DlgProc);
	if(!MSCompAss.Create(NULL, hInstance, "IDD_MAIN", ModelessProc))
		return 0L;

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