/********************************************************************* * general_on_initdialog [internal] * * handle WM_INITDIALOG * */ static VOID general_on_initdialog(HWND hwnd) { WCHAR buffer[INTERNET_MAX_URL_LENGTH]; DWORD len; DWORD type; LONG res; DWORD *ptr = disabled_general_buttons; /* disable unimplemented buttons */ while (*ptr) { EnableWindow(GetDlgItem(hwnd, *ptr), FALSE); ptr++; } /* read current homepage from the registry. Try HCU first, then HKLM */ *buffer = 0; len = sizeof(buffer); type = REG_SZ; res = SHRegGetUSValueW(reg_ie_main, start_page, &type, buffer, &len, FALSE, (LPBYTE) about_blank, sizeof(about_blank)); if (!res && (type == REG_SZ)) { SetDlgItemTextW(hwnd, IDC_HOME_EDIT, buffer); } }
/********************************************************************* * general_on_command [internal] * * handle WM_COMMAND * */ static INT_PTR general_on_command(HWND hwnd, WPARAM wparam) { WCHAR buffer[INTERNET_MAX_URL_LENGTH]; DWORD len; DWORD type; LONG res; switch (wparam) { case MAKEWPARAM(IDC_HOME_EDIT, EN_CHANGE): /* enable apply button */ SendMessageW(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0); break; case MAKEWPARAM(IDC_HOME_BLANK, BN_CLICKED): SetDlgItemTextW(hwnd, IDC_HOME_EDIT, about_blank); break; case MAKEWPARAM(IDC_HOME_DEFAULT, BN_CLICKED): len = sizeof(buffer); type = REG_SZ; res = SHRegGetUSValueW(reg_ie_main, default_page, &type, buffer, &len, FALSE, (LPBYTE) about_blank, sizeof(about_blank)); if (!res && (type == REG_SZ)) SetDlgItemTextW(hwnd, IDC_HOME_EDIT, buffer); break; case MAKEWPARAM(IDC_HISTORY_DELETE, BN_CLICKED): DialogBoxW(hcpl, MAKEINTRESOURCEW(IDD_DELETE_HISTORY), hwnd, delhist_dlgproc); break; default: TRACE("not implemented for command: %d/%d\n", HIWORD(wparam), LOWORD(wparam)); return FALSE; } return TRUE; }