Beispiel #1
0
LRESULT CRetrySplashScreen::OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    
    HDC hdc = (HDC) wParam;
    HWND hwnd = (HWND) lParam;
    
    int DlgCtrlID = ::GetDlgCtrlID(hwnd);
	
	if (DlgCtrlID == IDC_SPLASH_LINE1){
		
        if (m_hDialogFont == NULL){
			m_hDialogFont = CreateDialogFont(hdc, TEXT("Sun Sans"), 10, FW_MEDIUM, FALSE);
        }
        
        ::SelectObject(hdc, m_hDialogFont);
        ::SetBkMode(hdc, TRANSPARENT);
        return (LRESULT) GetStockObject(WHITE_BRUSH);	
        
	} else if (DlgCtrlID == IDC_SPLASH_HEADER){
        
        if (m_hDialogHeaderFont == NULL){
            m_hDialogHeaderFont = CreateDialogFont(hdc, TEXT("Sun Sans"), 12, FW_BOLD, FALSE);
        }
        
        ::SelectObject(hdc, m_hDialogHeaderFont);
        ::SetBkMode(hdc, TRANSPARENT);
        return (LRESULT) GetStockObject(WHITE_BRUSH);
        
    } else if (DlgCtrlID == IDC_BANNER){
        
     	if (m_hMemDC == NULL){
            
            m_hBitmap = LoadBitmap(_Module.GetModuleInstance(),
                                   MAKEINTRESOURCE(IDI_BANNER));
            GetObject(m_hBitmap, sizeof(BITMAP), &m_bmBannerJFX);
            m_hMemDC = CreateCompatibleDC(NULL);
            SelectObject(m_hMemDC, m_hBitmap);
            
	    }
        
	    RECT rect;
	    ::GetClientRect(hwnd, &rect);
	    StretchBlt(hdc, rect.left, rect.top, (rect.right - rect.left), (rect.bottom - rect.top),
                   m_hMemDC, 0, 0, m_bmBannerJFX.bmWidth, m_bmBannerJFX.bmHeight, SRCCOPY);
        
	    return (LRESULT) GetStockObject(NULL_BRUSH);
    }
    
    return (LRESULT) GetStockObject(WHITE_BRUSH);
    
}
Beispiel #2
0
/*-------------------------------------------
  initialize
---------------------------------------------*/
void InitTCPlayer(void)
{
	GetModuleFileName(g_hInst, g_mydir, MAX_PATH);
	del_title(g_mydir);
	strcpy(g_inifile, g_mydir);
	add_title(g_inifile, "tclock.ini");
	g_bIniSetting = TRUE;
	
	// common/langcode.c
	FindFileWithLangCode(g_langfile, GetUserDefaultLangID(), TCLANGTXT);
	g_hfontDialog = CreateDialogFont();
	
	g_hwndClock = GetClockWindow();
	
	SetOnContextMenu();
}
Beispiel #3
0
/*-------------------------------------------
  initialize
---------------------------------------------*/
void InitTCProp(void)
{
	GetModuleFileName(g_hInst, g_mydir, MAX_PATH);
	del_title(g_mydir);
	strcpy(g_inifile, g_mydir);
	add_title(g_inifile, "tclock.ini");
	g_bIniSetting = TRUE;
	
	// common/langcode.c
	FindFileWithLangCode(g_langfile, GetUserDefaultLangID(), TCLANGTXT);
	g_hfontDialog = CreateDialogFont();
	
	g_winver = CheckWinVersion();
	
	g_hIconPlay = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON,
		16, 16, LR_DEFAULTCOLOR|LR_SHARED);
	g_hIconStop = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON,
		16, 16, LR_DEFAULTCOLOR|LR_SHARED);
}
Beispiel #4
0
// this message is sent each time a static control is drawn.
// we get the Control ID and then set background color and font
// as appropriate for that control.
//
LRESULT CWelcomeDialog::OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{

    HDC hdc = (HDC) wParam;
    HWND hwnd = (HWND) lParam;

    int DlgCtrlID = ::GetDlgCtrlID(hwnd);
	
	if ((DlgCtrlID == IDC_WELCOME_LINE1) || (DlgCtrlID == IDC_WELCOME_LICENSE_TEXT1) || (DlgCtrlID == IDC_WELCOME_LICENSE_TEXT2)
		|| (DlgCtrlID == IDC_WELCOME_NOTE) || (DlgCtrlID == IDC_WELCOME_MORE_INFO)){
		
        if (m_hDialogFont == NULL){
			m_hDialogFont = CreateDialogFont(hdc, TEXT("Sun Sans"), 10, FW_MEDIUM, FALSE);
        }
         
        if (DlgCtrlID == IDC_WELCOME_LINE1){
            
            TCHAR szText[BUFFER_SIZE] = {NULL};
            ::LoadString(_Module.GetResourceInstance(), IDS_WELCOME_LINE1, szText, BUFFER_SIZE);
            ::SetWindowText(hwnd, szText);

        }
        
        ::SelectObject(hdc, m_hDialogFont);
        return (LRESULT) GetStockObject(WHITE_BRUSH);	

	} else if (DlgCtrlID == IDC_WELCOME_HEADER){

        TCHAR szHeaderText[BUFFER_SIZE] = {NULL};
        
        if (m_hDialogHeaderFont == NULL){
            m_hDialogHeaderFont = CreateDialogFont(hdc, TEXT("Sun Sans"), 12, FW_BOLD, FALSE);
        }
        
        ::LoadString(_Module.GetResourceInstance(), IDS_WELCOME_MAIN, szHeaderText, BUFFER_SIZE);
        ::SetWindowText(hwnd, szHeaderText);
        
        ::SelectObject(hdc, m_hDialogHeaderFont);
        ::SetBkMode(hdc, TRANSPARENT);
        return (LONG)m_hDlgBrush1;

    } else if (DlgCtrlID == IDC_BACK_COLOR){

        return (LRESULT) GetStockObject(WHITE_BRUSH);
        
    } else if (DlgCtrlID == IDC_BANNER){

     	if (m_hMemDC == NULL){

            m_hBitmap = LoadBitmap(_Module.GetModuleInstance(),
                                   MAKEINTRESOURCE(IDI_BANNER));
            GetObject(m_hBitmap, sizeof(BITMAP), &m_bmBannerJFX);
            m_hMemDC = CreateCompatibleDC(NULL);
            SelectObject(m_hMemDC, m_hBitmap);

	    }

	    RECT rect;
	    ::GetClientRect(hwnd, &rect);
	    StretchBlt(hdc, rect.left, rect.top, (rect.right - rect.left), (rect.bottom - rect.top),
                   m_hMemDC, 0, 0, m_bmBannerJFX.bmWidth, m_bmBannerJFX.bmHeight, SRCCOPY);

	    return (LRESULT) GetStockObject(NULL_BRUSH);

    } else if ((DlgCtrlID == IDC_WELCOME_LICENSE_AGREEMENT) || (DlgCtrlID == IDC_WELCOME_CLICK_HERE)){

        if (m_hDialogFont == NULL){
	        m_hDialogFont = CreateDialogFont(hdc, TEXT("Sun Sans"), 10, FW_MEDIUM, FALSE);
	    }

	    ::SelectObject(hdc, m_hDialogFont);
	    ::SetBkMode(hdc, TRANSPARENT);
        ::SetTextColor(hdc, RGB(255, 0, 0));

        return (LRESULT) GetStockObject(NULL_BRUSH);

    } else if (DlgCtrlID == IDC_WELCOME_CHECKBOX){

        // Disable the checkbox if PIP/Re-install
        if (getIsCheckboxDisabled()){
            ::ShowWindow(hwnd, SW_HIDE);
        }
        
        // Set Checkbox text transparent
        ::SetBkMode(hdc, TRANSPARENT);

    }

    return (LONG)m_hDlgBrush1;

}
Beispiel #5
0
void CreateTapeView(HWND hwndParent, int x, int y, int width, int height)
{
    ASSERT(hwndParent != NULL);

    g_hwndTape = CreateWindow(
            CLASSNAME_TOOLWINDOW, NULL,
            WS_CHILD | WS_VISIBLE,
            x, y, width, height,
            hwndParent, NULL, g_hInst, NULL);
    SetWindowText(g_hwndTape, _T("Tape"));

    // ToolWindow subclassing
    m_wndprocTapeToolWindow = (WNDPROC) LongToPtr( SetWindowLongPtr(
            g_hwndTape, GWLP_WNDPROC, PtrToLong(TapeViewWndProc)) );

    RECT rcClient;  GetClientRect(g_hwndTape, &rcClient);

    m_hwndTapeFile = CreateWindow(
            _T("STATIC"), NULL,
            WS_CHILD | WS_VISIBLE | SS_PATHELLIPSIS,
            8, 4, 500, 18,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeCurrent = CreateWindow(
            _T("STATIC"), NULL,
            WS_CHILD | WS_VISIBLE,
            8, 62, 100, 18,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeTotal = CreateWindow(
            _T("STATIC"), NULL,
            WS_CHILD | WS_VISIBLE | SS_RIGHT,
            500 + 8 + 4, 4, rcClient.right - 8 * 2 - 500 - 4, 18,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeGraph = CreateWindow(
            _T("STATIC"), NULL,
            WS_CHILD | WS_VISIBLE | SS_OWNERDRAW,
            8, 22, TAPE_BUFFER_SIZE, 32,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapePlay = CreateWindow(
            _T("BUTTON"), _T("Play"),
            WS_CHILD | WS_VISIBLE | WS_DISABLED,
            8 + 100 + 16, 60, 96, 22,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeRewind = CreateWindow(
            _T("BUTTON"), _T("<< Rewind"),
            WS_CHILD | WS_VISIBLE | WS_DISABLED,
            8 + 100 + 16 + 4 + 96, 60, 96, 22,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeOpen = CreateWindow(
            _T("BUTTON"), _T("Open WAV"),
            WS_CHILD | WS_VISIBLE,
            rcClient.right - 96 - 4 - 96 - 8, 60, 96, 22,
            g_hwndTape, NULL, g_hInst, NULL);
    m_hwndTapeSave = CreateWindow(
            _T("BUTTON"), _T("Save WAV"),
            WS_CHILD | WS_VISIBLE,
            rcClient.right - 96 - 8, 60, 96, 22,
            g_hwndTape, NULL, g_hInst, NULL);

    m_hfontTape = CreateDialogFont();
    SendMessage(m_hwndTapeCurrent, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapeTotal, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapeFile, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapePlay, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapeRewind, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapeOpen, WM_SETFONT, (WPARAM) m_hfontTape, 0);
    SendMessage(m_hwndTapeSave, WM_SETFONT, (WPARAM) m_hfontTape, 0);

    TapeView_ClearGraph();
}