Ejemplo n.º 1
0
//=--------------------------------------------------------------------------=
// CWelcomeDialog::OnCancel
//=--------------------------------------------------------------------------=
// Message handler for WM_COMMAND with IDCANCEL
//
// Parameters:
//	wNotifyCode Notify Code
//	wID	    ID of control
//	hWndCtl	    HWND of control
//	bHandled    FALSE if not handled
//
// Output:
//	LRESULT	    
//
// Notes:
//
LRESULT CWelcomeDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{

    // First display an "are you sure you want to cancel" prompt
    TCHAR szAskMsg[BUFFER_SIZE] = {NULL};
    TCHAR szCaption[BUFFER_SIZE] = {NULL};
    TCHAR szMsg[BUFFER_SIZE] = {NULL};
    
	::LoadString(_Module.GetResourceInstance(), IDS_AREYOUSURE_MESSAGE, szAskMsg, BUFFER_SIZE);
	::LoadString(_Module.GetResourceInstance(), IDS_AREYOUSURE_CAPTION, szCaption, BUFFER_SIZE);
	wsprintf(szMsg, szAskMsg, VERSION);
	
    if (MessageBox(szMsg, szCaption, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) != IDYES){
        return 0;
    }

    // We need to set the 'declined' regkey to avoid sending an IS2 ping
    // this was done via a custom action kicked off by the MSI Welcome Screen
    DWORD created = 0;
    HKEY hKey;
    
    RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\JavaSoft", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &created);
    RegSetValueEx(hKey, "InstallStatus", 0, REG_SZ, (LPBYTE)"decline", lstrlen("decline"));
    RegCloseKey(hKey);
    
    // Disable window first to avoid any keyboard input
    EnableWindow(FALSE);
    FreeGDIResources();

    // Destroy dialog
    EndDialog(wID);

    return 0;
}
Ejemplo n.º 2
0
//=--------------------------------------------------------------------------=
// CWelcomeDialog::OnOK
//=--------------------------------------------------------------------------=
// Message handler for WM_COMMAND with IDOK
//
// Parameters:
//	wNotifyCode Notify Code
//	wID	    ID of control
//	hWndCtl	    HWND of control
//	bHandled    FALSE if not handled
//
// Output:
//	LRESULT	    
//
// Notes:
//
LRESULT CWelcomeDialog::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{

    // Disable window first to avoid any keyboard input
    EnableWindow(FALSE);
    FreeGDIResources();

    // Trap User request to change installation dir
    if (IsDlgButtonChecked(IDC_WELCOME_CHECKBOX)){
        setIsAltInstallDir(TRUE);
    } else {
        setIsAltInstallDir(FALSE);
    }
    
    // Destroy dialog
    EndDialog(wID);

    return 0;
}
Ejemplo n.º 3
0
CRetrySplashScreen::~CRetrySplashScreen()
{
    EnableWindow(FALSE);
    FreeGDIResources();
}