Esempio n. 1
0
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR commandLine, int cmdShow)
{
    if( !COverlappedWindow::RegisterClass() ) {
        return -1;
    }
    COverlappedWindow window;
    if( !window.Create() ) {
        return -1;
    }
    window.Show(cmdShow);
    HACCEL acceleratorHandle = ::LoadAccelerators(GetModuleHandle(0), MAKEINTRESOURCE(IDR_ACCELERATOR1));

    MSG message;
    BOOL getMessageResult = 0;
    while( getMessageResult = ::GetMessage(&message, 0, 0, 0) ) {
        if( getMessageResult == -1 ) {
            return -1;
        } else {
            if( !TranslateAccelerator(window.Handle(), acceleratorHandle, &message) ) {
                ::TranslateMessage(&message);
                ::DispatchMessage(&message);
            }
        }
    }
    return 0;
}
Esempio n. 2
0
void CDialogWindow::ApplySettings(CSettings settings)
{
	COverlappedWindow* parentWindow = reinterpret_cast<COverlappedWindow*>(GetWindowLongPtr(parentHandle, GWLP_USERDATA));
	drawer->SetFontSize(settings.font.lfHeight);
	drawer->SetOpacity(parentWindow->Handle(), settings.opacity);
	drawer->SetColor("Background", settings.backgroundColor, false, true);
	drawer->SetColor("NumbersUnsatisfied", settings.fontColorUnsat, false, false);
	drawer->SetColor("NumbersSatisfied", settings.fontColorSat, false, false);
	drawer->SetColor("BorderInactive", settings.lineColorGrid, true, false);
	drawer->SetColor("BorderActive", settings.lineColorCorr, true, false);
	drawer->SetColor("BorderWrong", settings.lineColorWrong, true, false);
	
	parentWindow->Repaint();
}