Пример #1
1
extern void ConsoleInit(void)
{
	CONSOLE_CURSOR_INFO cci;
	int i;
	
	/* コンソール標準出力画面のハンドルを取得。プログラム終了時にアクティブ化 */	
	m_hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);

	if (m_hStdOut == INVALID_HANDLE_VALUE)
	{
		fprintf(stderr, "error: Console: InitConsole: hStdOut: %ld\n", GetLastError());
	}
	
	/* コンソールスクリーンの作成と初期化 */
	for (i=0; i<NUM_SCREEN_MAX; i++)
	{
		m_hScreen[i] = CreateConsoleScreenBuffer(
			GENERIC_READ | GENERIC_WRITE,
			0,
			NULL,
			CONSOLE_TEXTMODE_BUFFER,
			NULL
		);
		if (m_hScreen[i] == INVALID_HANDLE_VALUE)
		{
			fprintf(stderr, "error: Console: InitConsole: %ld\n", GetLastError());
		}
		
		/* カーソル情報の初期化 */
		GetConsoleCursorInfo(m_hScreen[i], &cci);
		cci.bVisible = FALSE;// カーソルの非表示
		SetConsoleCursorInfo(m_hScreen[i], &cci);
		
		/* ウィンドウサイズの初期化 */
		SetWindowSize(m_hScreen[i], NUM_WINDOW_HEIGHT, NUM_WINDOW_WIDTH);
		
		/* コンソールモードの初期化 */
		SetConsoleMode(m_hScreen[i], ENABLE_PROCESSED_OUTPUT);
	}
	m_hScreenIndex	= 0;
	m_hOut			= m_hScreen[1];
    m_hWork			= m_hScreen[0];
	SetConsoleActiveScreenBuffer(m_hOut);// 出力スクリーンをアクティブ化
}
Пример #2
0
void Platform_Win32_Screen::SetFullscreen(bool fullscreen)
	{
	if (fullscreen_==fullscreen)
		{
		return;
		}

	fullscreen_=fullscreen;

	if (technologyInstance_)
		{
		disableOnWmSize_++;

		delete technologyInstance_;
		technologyInstance_=0;

		if (!GetFullscreen())
			{
			SetWindowSize();
			}

		SetTechnology(technology_);

		if (technology_==Technology_DDraw && !GetFullscreen())
			{
			SetWindowSize();
			}

		disableOnWmSize_--;
		}
	}
Пример #3
0
void ScheddStatistics::Reconfig()
{
    int quantum = param_integer("STATISTICS_WINDOW_QUANTUM_SCHEDULER", INT_MAX, 1, INT_MAX);
    if (quantum >= INT_MAX)
        quantum = param_integer("STATISTICS_WINDOW_QUANTUM_SCHEDD", INT_MAX, 1, INT_MAX);
    if (quantum >= INT_MAX)
        quantum = param_integer("STATISTICS_WINDOW_QUANTUM", 4*60, 1, INT_MAX);
    this->RecentWindowQuantum = quantum;

    this->RecentWindowMax = param_integer("STATISTICS_WINDOW_SECONDS", 1200, quantum, INT_MAX);



    this->PublishFlags    = IF_BASICPUB | IF_RECENTPUB;
    char * tmp = param("STATISTICS_TO_PUBLISH");
    if (tmp) {
       this->PublishFlags = generic_stats_ParseConfigString(tmp, "SCHEDD", "SCHEDULER", this->PublishFlags);
       free(tmp);
    }
    SetWindowSize(this->RecentWindowMax);

    //stats_histogram_sizes::init_sizes_from_param("MAX_HIST_SIZES_LEVELS");
    //JobSizes.reconfig();
    //JobSizesGoodput.reconfig();
    //JobSizesBadput.reconfig();
}
Пример #4
0
void Platform_Win32_Screen::FirstTimeInitialize()
	{
	disableOnWmSize_++;


	// Initialize window size
	if (!GetFullscreen())
		{
		SetWindowSize();
		}

	if (forceddraw_ || IsRunningOnWine())
		{
		SetTechnology(Technology_DDraw);
		}
	else if (forcegdi_)
		{
		SetTechnology(Technology_GDI);
		}
	else
		{
		SetTechnology(Technology_D3D9);
		}

	// Show window
	ShowWindow(windowHandle_,SW_SHOW);

	disableOnWmSize_--;
	}
Пример #5
0
/*
 * Function: main
 * -----------------
 * Serves as entry point of program. Takes in all user inputs to determine specific boggle configuration.
 * Then, it gives the user a chance to find words in the boggleBoard. Then, the computer takes over
 * to find any remaining words. Finally, gives user option to play another round.
 *
 *@return 0 if program completed successfully.
 */
int main()
{
	Randomize(); //initializes random constructor
	SetWindowSize(8, 5);
	InitGraphics();
	Welcome();
	GiveInstructions();
	Lexicon wordList("lexicon.dat"); //generates list of all possible words
	while (true) {
		Lexicon usedWords; //generates a list that stores all words found by the player and computer
		InitGraphics();
		SoundFeature();
		int boardDimension = BoggleBoardSize();
		DrawBoard(boardDimension, boardDimension);
		Grid<char> boggleBoard(boardDimension, boardDimension);
		if (!UserBoardConfiguration()) {
			InitializeRandomBoard(boggleBoard); //if user chooses not to specify board configuration, a random one is generated
		} else {
			string diceConfig = GetDiceConfiguration(boardDimension);
			SetDiceConfiguration(boggleBoard, diceConfig);
		}
		DrawBoggleBoard(boggleBoard);
		Grid<bool> usedDice(boggleBoard.numRows(), boggleBoard.numCols());
		CreateMarker(usedDice);
		InputGuesses(boggleBoard, wordList, usedWords, usedDice); //player's turn
		FindRemainingWords(boggleBoard, wordList, usedWords, usedDice); //computer's turn
		PlayNamedSound("thats pathetic.wav"); //assumes the player will always lose to the computer
		if (!GameContinue()) break;
	}
	return 0;
}
Пример #6
0
BOOL COptionTreeImagePopUp::Create(CPoint pPoint)
{
	// Declare variables
	CString strClassName;

    // Get the class name and create the window
    strClassName = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 0, (HBRUSH) (COLOR_BTNFACE+1), 0);

	// Create window
    if (!CWnd::CreateEx(0, strClassName, _T(""), WS_POPUP | WS_VISIBLE, pPoint.x, pPoint.y, 100, 100, m_pParent->GetSafeHwnd(), 0, NULL))
	{
        return FALSE;
	}

	// Show window
	ShowWindow(SW_SHOWNA);

    // Set the window size
    SetWindowSize();
	
	// Setup images
	SetUpImages();

	// Setup tooltips
	SetUpToolTips();

    // Capture all mouse events for the life of this window
    SetCapture();

	return TRUE;
}
Пример #7
0
void SetupEnvironment(TSession *Session)
{
char *Token=NULL, *ptr, *dptr;

setenv("LD_LIBRARY_PATH","/usr/local/lib:/usr/lib:/lib",1);
setenv("HOME",Session->HomeDir,TRUE);
if (StrLen(Settings.TermType)) setenv("TERM",Settings.TermType,TRUE);

SetWindowSize(0);

ptr=GetToken(Settings.Environment,",",&Token,GETTOKEN_QUOTES);
while (ptr)
{
	dptr=strchr(Token,'=');
	if (dptr)
	{
		*dptr='\0';
		dptr++;
	}
	else dptr="";
	setenv(Token, dptr, TRUE);
	ptr=GetToken(ptr,",",&Token,GETTOKEN_QUOTES);
}

DestroyString(Token);
}
Пример #8
0
void cWindow::WindowDecrease() {

	// If we're in full screen mode remove it
	if (!mWindowMode) {

		mWindowMode = true;
		SetWindowSize(mWindow_Multiplier);

		return;
	}

	if (!CanChangeToMultiplier(mWindow_Multiplier - 1))
		return;

	SetWindowSize(mWindow_Multiplier - 1);
}
Пример #9
0
void DaemonCore::Stats::Reconfig()
{
    int window = param_integer("DCSTATISTICS_WINDOW_SECONDS", -1, -1, INT_MAX);
    if (window < 0)
       window = param_integer("STATISTICS_WINDOW_SECONDS", 1200, 1, INT_MAX);

    int quantum = configured_statistics_window_quantum();
    this->RecentWindowQuantum = quantum;
    this->RecentWindowMax = (window + quantum - 1) / quantum * quantum;

    this->PublishFlags    = 0 | IF_RECENTPUB;
    char * tmp = param("STATISTICS_TO_PUBLISH");
    if (tmp) {
       this->PublishFlags = generic_stats_ParseConfigString(tmp, "DC", "DAEMONCORE", this->PublishFlags);
       free(tmp);
    }
    SetWindowSize(this->RecentWindowMax);

    std::string strWhitelist;
    if (param(strWhitelist, "STATISTICS_TO_PUBLISH_LIST")) {
       this->Pool.SetVerbosities(strWhitelist.c_str(), this->PublishFlags, true);
    }

    std::string timespans;
    param(timespans,"DCSTATISTICS_TIMESPANS");

    std::string timespans_err;
    if( !ParseEMAHorizonConfiguration(timespans.c_str(),ema_config,timespans_err) ) {
        EXCEPT("Error in DCSTATISTICS_TIMESPANS=%s: %s",timespans.c_str(),timespans_err.c_str());
    }

    this->Commands.ConfigureEMAHorizons(ema_config);
}
Пример #10
0
void
CBlastNucleotideOptionsHandle::SetInitialWordOptionsDefaults()
{
    SetXDropoff(BLAST_UNGAPPED_X_DROPOFF_NUCL);
    SetWindowSize(BLAST_WINDOW_SIZE_NUCL);
    SetOffDiagonalRange(BLAST_SCAN_RANGE_NUCL);
}
void WindowAttributesPickle::SaveAttributes()
{
    SetWindowSize(m_name, m_window->GetSize());
    SetWindowPos(m_name, m_window->GetPosition());
#ifndef __WXMAC__
    GetWindowMaximized(m_name, m_window->IsMaximized());
#endif
}
Пример #12
0
CVisBlendedSequence<TPixel>::CVisBlendedSequence( int WindowSize )
    : CVisSequence<TPixel>(0, evissequenceLimitMemoryUsage|
                              evissequenceDelayReadUntilNeeded)
{
    SetWindowSize(WindowSize);
    m_pBlendRow = NULL;
    Reset();
}
Пример #13
0
void cWindow::SetFullScreen() {

	if (mWindowMode) {

		mWindow_MultiplierPrevious = mWindow_Multiplier;

		SetWindowSize(CalculateFullscreenSize());

		SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN);

		mWindowMode = false;
	}
	else {
		mWindowMode = true;
		SetWindowSize(mWindow_MultiplierPrevious);
	}
}
Пример #14
0
int main()
{
	SetWindowSize(9, 5);
	InitGraphics();
	Welcome();
	GiveInstructions();
	return 0;
}
Пример #15
0
int CColourPicker::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
    if (CButton::OnCreate(lpCreateStruct) == -1)
        return -1;
    
    SetWindowSize();    // resize appropriately
    return 0;
}
Пример #16
0
int ResizeToolbar(HWND hwndTB)
{
	RECT rect;
	SendMessage(hwndTB, TB_AUTOSIZE, 0, 0);
	GetToolbarRect(hwndTB, &rect);
	SetWindowSize(hwndTB, rect.right-rect.left, rect.bottom-rect.top, NULL);

	return rect.bottom-rect.top;
}
Пример #17
0
void cWindow::SetOriginalRes( const cDimension& pDimension ) {

	mOriginalResolution = pDimension;
	
	if (!mWindowMode) {
		SetFullScreen();
		SetFullScreen();
	} else
		SetWindowSize( mWindow_Multiplier );
}
Пример #18
0
void cWindow::CalculateWindowSize() {
	SDL_DisplayMode current;
	SDL_GetCurrentDisplayMode(0, &current);

	while ((mOriginalResolution.mWidth * mWindow_Multiplier) <= (unsigned int) (current.w / 2) &&
		(mOriginalResolution.mHeight * mWindow_Multiplier) <= (unsigned int) (current.h / 2)) {
		++mWindow_Multiplier;
	}

	SetWindowSize(mWindow_Multiplier);
}
Пример #19
0
bool cfg_window_size::on_window_creation(HWND p_wnd)
{
	bool ret = false;
	PFC_ASSERT(!m_windows.have_item(p_wnd));
	m_windows.add_item(p_wnd);

	if (g_is_enabled())
	{
		if (SetWindowSize(p_wnd,m_width,m_height)) ret = true;
	}

	return ret;
}
Пример #20
0
void cWindow::WindowDecrease() {

	// If we're in full screen mode remove it
	if (!mWindowMode) {

		//while (CanChangeToMultiplier( mWindow_MultiplierPrevious )) {
		//	++mWindow_MultiplierPrevious;
		//}

		//--mWindow_Multiplier;

		mWindowMode = true;
		SetWindowSize( mWindow_Multiplier );

		return;
	}

	if (!CanChangeToMultiplier(mWindow_Multiplier - 1 ))
		return;

	SetWindowSize( mWindow_Multiplier - 1 );
}
Пример #21
0
BOOL COptionTreeColorPopUp::Create(CPoint pPoint, COLORREF crColor, CWnd* pParentWnd, LPCTSTR szDefaultText, LPCTSTR szCustomText)
{
    // Declare variables
	CString strClassName;
	
	// Verify window
	ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
  
    // Se variables
	m_wndParent = pParentWnd;
    m_crColor = m_crInitialColor = crColor;

    // Get the class name and create the window
    strClassName = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 0, (HBRUSH) (COLOR_BTNFACE+1), 0);

	// Create window
    if (!CWnd::CreateEx(0, strClassName, _T(""), WS_POPUP | WS_VISIBLE, pPoint.x, pPoint.y, 100, 100, pParentWnd->GetSafeHwnd(), 0, NULL))
	{
        return FALSE;
	}

	// Show window
	ShowWindow(SW_SHOWNA);

    // Store the Custom text
    if (szCustomText != NULL) 
	{
        m_strCustomText = szCustomText;
	}

    // Store the Default Area text
    if (szDefaultText != NULL) 
	{
        m_strDefaultText = szDefaultText;
	}
        
    // Set the window size
    SetWindowSize();

    // Create the tooltips
    CreateToolTips();

    // Find which cell (if any) corresponds to the initial color
    FindCellFromColor(crColor);

    // Capture all mouse events for the life of this window
    SetCapture();

    return TRUE;
}
Пример #22
0
/*!
@brief 描画領域からウィンドウのサイズ設定
@par   関数説明
ウィンドウのサイズを描画領域を基準にして設定する。設定反映はSetWindow()関数を使う。
@param unsigned int width 横幅を与える。
@param unsigned int height 高さを与える。
@return 0=設定値が両方引数と異なる
@return 1=横幅は設定値が異なるが高さの設定値は引数通り
@return 2=横幅は設定値が引数通りだが高さの設定値は異なる
@return 3=設定値が両方引数と同じ
*/
int Window::SetScreenSize( unsigned int width, unsigned int height )
{
	RECT rect;
	rect.left = 0;
	rect.right = width;
	rect.top = 0;
	rect.bottom = height;

	AdjustWindowRectEx( &rect, GetWindowStyle(), false, GetWindowStyleEx() );
	return SetWindowSize( rect.right - rect.left, rect.bottom - rect.top );
	/*  return  SetWindowSize(
		width  + GetSystemMetrics(SM_CXEDGE) + GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXDLGFRAME),
		height + GetSystemMetrics(SM_CYEDGE) + GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION));*/
}
Пример #23
0
	void RegisterWatcher::CreateChildren(HWND hWnd){
		int ypos=0;
		int height=0, width=0;
		for(int i=REGWATCHER_AX; i<=REGWATCHER_IP; i++){
			SingleRegWatcher* w=m_regWatchers[i]=new SingleRegWatcher(i);
			w->Create(hWnd);
			w->SetName(m_regNames[i]);
			SetWindowXY(w->GetHWND(), 0, ypos);
			height=w->WindowHeight();
			width=w->WindowWidth();
			ypos+=height;
		}
		SetWindowSize(hWnd, width, ypos+height);
	}
Пример #24
0
int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR args, int show)
{
	lib::win::InitSpecificCommonControls(ICC_LISTVIEW_CLASSES);
	
	HICON icon = LoadIcon(instance, MAKEINTRESOURCE(ID_ICO_APPLICATION));
	lib::win::WindowClass wcmw("MAIN_WINDOW_CLASS", MainWindowProc, NULL, icon);
	
	lib::win::WindowHandle hwnd;
	hwnd.Create(wcmw, "MainPaneClass Tester", WS_OVERLAPPEDWINDOW);
	SetWindowSize(hwnd, 480, 400);
	ShowWindow(hwnd, SW_SHOW);
	
	lib::win::EnterMessageLoop();
	
	return 0;
}
Пример #25
0
	bool IrisApp::Init(HINSTANCE hInstance, int width, int height, bool(*pf)(), wstring title, IR_PARAM_RESULT_CT){
		GdiplusStartupInput m_gdiplusStartupInput;
		GdiplusStartup(&m_pGdiToken, &m_gdiplusStartupInput, NULL);

		this->ptr_display = pf;

		if (!d3d::InitD3D(hInstance, width, height, true, D3DDEVTYPE_HAL, &Device)){
			IR_PARAM_SET_RESULT(IR_RFAILED, L"Error in InitD3D!")
			::MessageBox(0, L"InitD3D() - FAILED", 0, 0);
			return false;
		}

		if (!d3d::InitD3DInput(ModuleIrisGraphics::GetHwnd(), hInstance, &KeyBoardInputDevice, &MouseInputDevice)){
			IR_PARAM_SET_RESULT(IR_RFAILED, L"Error in InitD3D Input!")
			::MessageBox(0, L"InitD3DInput() - FAILED", 0, 0);
			return false;
		}
		
		if (!ModuleIrisAudio::InitAudio(64)){
			IR_PARAM_SET_RESULT(IR_RFAILED, L"Error in Init Audio!")
			::MessageBox(0, L"InitAudio() - FAILED", 0, 0);
			return false;
		}

		if (!d3d::InitD3DShader(Device)){
			IR_PARAM_SET_RESULT(IR_RFAILED, L"Error in Init Shader!")
			::MessageBox(0, L"InitShader() - FAILED", 0, 0);
			return false;
		}

		if (!Setup(width, height)){
			IR_PARAM_SET_RESULT(IR_RFAILED, L"Error in Setup!")
			::MessageBox(0, L"Setup() - FAILED", 0, 0);
			return false;
		}

		::SetWindowTextW(ModuleIrisGraphics::GetHwnd(), title.c_str());

		ModuleIrisGraphics::SetWidth(width);
		ModuleIrisGraphics::SetHeight(height);

		SetWindowSize();

		IR_PARAM_SET_RESULT(IR_RSUCCESS, L"")

		return true;
	}
Пример #26
0
void Game1::Init(){
	//Set up window options before initiating Game
	SetWindowSize(sf::Vector2i(640, 480));

	Game::Init();

	Window->setVerticalSyncEnabled(true);
	Window->setFramerateLimit(60);

	stateManager->Init();

	PlayState* testState = new PlayState;
	//MainMenu* mainMenu = new MainMenu;
	stateManager->AddState(testState);

	
}
Пример #27
0
void SizeToContent(DOCKPANEL *dwp)
{
	RECT  rect = { 0,0,0,0 }, rect2;
	int x = 0, y = 0;

	if(dwp->hwndPanel == 0 || dwp->hwndContents == 0)
		return;
	
	if(dwp->DockSize.cx == 0 || (dwp->dwStyle & DWS_FIXED_HORZ))
		dwp->DockSize.cx = GetWindowWidth(dwp->hwndContents);
	
	if(dwp->FloatSize.cx == 0 || (dwp->dwStyle & DWS_FIXED_HORZ))
		dwp->FloatSize.cx = GetWindowWidth(dwp->hwndContents);
	
	if(dwp->DockSize.cy == 0 || (dwp->dwStyle & DWS_FIXED_VERT))
		dwp->DockSize.cy = GetWindowHeight(dwp->hwndContents);
	
	if(dwp->FloatSize.cy == 0 || (dwp->dwStyle & DWS_FIXED_VERT))
		dwp->FloatSize.cy = GetWindowHeight(dwp->hwndContents);
	
	if(dwp->fDocked)
	{
		rect.right = dwp->DockSize.cx;
		rect.bottom = dwp->DockSize.cy;
	}
	else
	{
		rect.right = dwp->FloatSize.cx;
		rect.bottom = dwp->FloatSize.cy;
	}

	CopyRect(&rect2, &rect);
	AdjustRectBorders(dwp, &rect, 1);
	
	TRACEA("SizeToContent: client=%d %d %d %d  adjusted=%d %d %d %d\n",
				rect2.left, rect2.top, rect2.right, rect2.bottom,
				rect.left, rect.top, rect.right, rect.bottom
				);

	if(!dwp->fDocked)
		CalcFloatingRect(dwp->hwndPanel, &rect);

	SetWindowSize(dwp->hwndPanel, RectWidth(&rect), RectHeight(&rect), NULL);

	PositionContent(dwp);
}
Пример #28
0
void InitPuzzleGraphics() {
	SetCoordinateSystem("screen");
	SetWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT + CONTROL_STRIP_HEIGHT);
	InitGraphics();
	DefineColor("CONTROL_STRIP", 0.90, 0.90, 0.90);
	DefineColor("STANDARD_BACKGROUND", 0.80, 0.80, 0.80);
	DefineColor("STANDARD_HIGHLIGHT", 1.00, 1.00, 1.00);
	DefineColor("STANDARD_INNERSHADE", 0.72, 0.72, 0.72);
	DefineColor("STANDARD_OUTERSHADE", 0.43, 0.43, 0.43);
	DefineColor("ACTIVATED_BACKGROUND", 0.00, 0.00, 1.00);
	DefineColor("ACTIVATED_BORDER", 0.00, 0.00, 0.90);
	DefineColor("ACTIVATED_INNERSHADE", 0.00, 0.00, 0.80);
	DefineColor("ACTIVATED_TEXT", 1.00, 1.00, 1.00);
	SetPenColor("CONTROL_STRIP");
	FillBox(0, WINDOW_HEIGHT, WINDOW_WIDTH, CONTROL_STRIP_HEIGHT);
	SetPenColor("Black");
	SetWindowTitle("Triangle Puzzle Solver");
}
Пример #29
0
void cWindow::WindowIncrease() {

	if (!mWindowMode)
		return;

	// Once we reach the max window size, go to full screen
	if (!CanChangeToMultiplier(mWindow_Multiplier + 1)) {

		SetFullScreen();
		mWindowMode = false;
		return;
	}

	if (!mWindowMode)
		return;

	SetWindowSize(mWindow_Multiplier + 1);
}
Пример #30
0
BOOL CColourPopup::Create(CPoint p, COLORREF crColour, CWnd* pParentWnd,
                          LPCTSTR szDefaultText /* = NULL */,
                          LPCTSTR szCustomText  /* = NULL */)
{
    ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
    ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CColourPicker)));

    m_pParent  = pParentWnd;
    m_crColour = m_crInitialColour = crColour;

    // Get the class name and create the window
    CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
                                              0,
                                              (HBRUSH) (COLOR_BTNFACE+1), 
                                              0);

    if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE/*|WS_POPUP*/ , 
                        p.x, p.y, 100, 100, // size updated soon
                        pParentWnd->GetSafeHwnd(), 0, NULL))
        return FALSE;

    // Store the Custom text
    if (szCustomText != NULL) 
        m_strCustomText = szCustomText;

    // Store the Default Area text
    if (szDefaultText != NULL) 
        m_strDefaultText = szDefaultText;
        
    // Set the window size
    SetWindowSize();

    // Create the tooltips
    CreateToolTips();

    // Find which cell (if any) corresponds to the initial colour
    FindCellFromColour(crColour);

    // Capture all mouse events for the life of this window
    SetCapture();

    return TRUE;
}