Exemple #1
0
DWORD myWndProcThread(LPVOID lpParam){
	RECT rectWin;
	memcpy(&rectWin, lpParam, sizeof(RECT));// (RECT)lpParam;

	HBRUSH redBrush = CreateSolidBrush(RGB(0xef,0x00,0x70));
    WNDCLASS wndclass = { 
		CS_DBLCLKS, 
		WindowProcedure,
        0, //clsExtra
		0, //winExtra
		GetModuleHandle(0), //instance
		NULL, //LoadIcon(0,IDI_APPLICATION),	//icon
        NULL, //LoadCursor(0,IDC_ARROW), //cursor
		HBRUSH(redBrush),//COLOR_WINDOW+1),	//background
        0, //menu name
		myclass //class name
	} ;
	int captH = GetSystemMetrics(SM_CYCAPTION);
    if( RegisterClass(&wndclass) )
    {
        HWND window = CreateWindowEx( 0, myclass, L"title",
                   WS_OVERLAPPED |													//WS_OVERLAPPED makes a floating window, 
				   WS_EX_CAPTIONOKBTN | WS_EX_TOPMOST | WS_EX_TOOLWINDOW | 
				   WS_SYSMENU,														// WS_SYSMENU shows the closing X in caption
				   rectWin.left, rectWin.top, //CW_USEDEFAULT, CW_USEDEFAULT,
                   rectWin.right, captH*2, //rectWin.bottom*2,// 200, 200, // CW_USEDEFAULT, CW_USEDEFAULT, 
				   0, 0, GetModuleHandle(0), 0 ) ;
        if(window)
        {
			hWndMain=window;
            ShowWindow( window, SW_SHOWNORMAL ) ;
			UpdateWindow(window);
			SetWindowTop(window, TRUE);
            MSG msg ;
			while( GetMessage( &msg, 0, 0, 0 ) ) {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}
		else{
			SetEvent(stopHandle);
			return -2;
		}
	}
	else {
		SetEvent(stopHandle);
		return -3;
	}
	stopApp=TRUE;
	SetEvent(stopHandle);
	return 0;
}
void Settings::SetDefaults()
////////////////////////////////////////////////////////////////////////
{
	SetAskOnExit(false);
	SetLanguage("English");
	SetWindowLeft(100);
	SetWindowTop(100);
	SetWindowWidth(600);
	SetWindowHeight(400);
	SetLeftPanelPath("/");
	SetRightPanelPath("/");
	SetTerminalWindow("Genesis Terminal");
}
void WindowAttributesPickle::SetWindowPos(const wxString& window, const wxPoint& pos)
{
    SetWindowLeft(window, pos.x);
    SetWindowTop(window, pos.y);
}