static void update_dialog(ProgressDialog *This, DWORD dwUpdate) { WCHAR empty[] = {0}; if (dwUpdate & UPDATE_TITLE) SetWindowTextW(This->hwnd, This->title); if (dwUpdate & UPDATE_LINE1) SetDlgItemTextW(This->hwnd, IDC_TEXT_LINE, (This->isCancelled ? empty : This->lines[0])); if (dwUpdate & UPDATE_LINE2) SetDlgItemTextW(This->hwnd, IDC_TEXT_LINE+1, (This->isCancelled ? empty : This->lines[1])); if (dwUpdate & UPDATE_LINE3) SetDlgItemTextW(This->hwnd, IDC_TEXT_LINE+2, (This->isCancelled ? This->cancelMsg : This->lines[2])); if (dwUpdate & UPDATE_PROGRESS) { ULONGLONG ullTotal = This->ullTotal; ULONGLONG ullCompleted = This->ullCompleted; /* progress bar requires 32-bit coordinates */ while (ullTotal >> 32) { ullTotal >>= 1; ullCompleted >>= 1; } SendDlgItemMessageW(This->hwnd, IDC_PROGRESS_BAR, PBM_SETRANGE32, 0, (DWORD)ullTotal); SendDlgItemMessageW(This->hwnd, IDC_PROGRESS_BAR, PBM_SETPOS, (DWORD)ullCompleted, 0); }
INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { switch(msg) { case WM_INITDIALOG: { const char* const *pstr = SHELL_Authors; // Add the authors to the list SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, WM_SETREDRAW, FALSE, 0 ); while (*pstr) { WCHAR name[64]; /* authors list is in utf-8 format */ MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) ); SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, LB_ADDSTRING, (WPARAM)-1, (LPARAM)name ); pstr++; } SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, WM_SETREDRAW, TRUE, 0 ); return TRUE; } } return FALSE; }
/*********************************************************************** * FD31_DirListDblClick [internal] */ static LRESULT FD31_DirListDblClick( const FD31_DATA *lfs ) { LONG lRet; HWND hWnd = lfs->hwnd; LPWSTR pstr; WCHAR tmpstr[BUFFILE]; /* get the raw string (with brackets) */ lRet = SendDlgItemMessageW(hWnd, lst2, LB_GETCURSEL, 0, 0); if (lRet == LB_ERR) return TRUE; pstr = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC); SendDlgItemMessageW(hWnd, lst2, LB_GETTEXT, lRet, (LPARAM)pstr); strcpyW( tmpstr, pstr ); HeapFree(GetProcessHeap(), 0, pstr); /* get the selected directory in tmpstr */ if (tmpstr[0] == '[') { tmpstr[lstrlenW(tmpstr) - 1] = 0; strcpyW(tmpstr,tmpstr+1); } strcatW(tmpstr, FILE_bslash); FD31_ScanDir(lfs->ofnW, hWnd, tmpstr); /* notify the app */ if (lfs->hook) { if (FD31_CallWindowProc(lfs, lfs->lbselchstring, lst2, MAKELONG(lRet,CD_LBSELCHANGE))) return TRUE; } return TRUE; }
static void update_shell_folder_listview(HWND dialog) { int i; LVITEMW item; LONG lSelected = SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1, MAKELPARAM(LVNI_SELECTED,0)); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_DELETEALLITEMS, 0, 0); for (i=0; i<NUM_ELEMS(asfiInfo); i++) { WCHAR buffer[MAX_PATH]; HRESULT hr; LPITEMIDLIST pidlCurrent; /* Some acrobatic to get the localized name of the shell folder */ hr = SHGetFolderLocation(dialog, asfiInfo[i].nFolder, NULL, 0, &pidlCurrent); if (SUCCEEDED(hr)) { LPSHELLFOLDER psfParent; LPCITEMIDLIST pidlLast; hr = SHBindToParent(pidlCurrent, &IID_IShellFolder, (LPVOID*)&psfParent, &pidlLast); if (SUCCEEDED(hr)) { STRRET strRet; hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_FORADDRESSBAR, &strRet); if (SUCCEEDED(hr)) { hr = StrRetToBufW(&strRet, pidlLast, buffer, MAX_PATH); } IShellFolder_Release(psfParent); } ILFree(pidlCurrent); } /* If there's a dangling symlink for the current shell folder, SHGetFolderLocation * will fail above. We fall back to the (non-verified) path of the shell folder. */ if (FAILED(hr)) { hr = SHGetFolderPathW(dialog, asfiInfo[i].nFolder|CSIDL_FLAG_DONT_VERIFY, NULL, SHGFP_TYPE_CURRENT, buffer); } item.mask = LVIF_TEXT | LVIF_PARAM; item.iItem = i; item.iSubItem = 0; item.pszText = buffer; item.lParam = (LPARAM)&asfiInfo[i]; SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTITEMW, 0, (LPARAM)&item); item.mask = LVIF_TEXT; item.iItem = i; item.iSubItem = 1; item.pszText = strdupU2W(asfiInfo[i].szLinkTarget); SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item); HeapFree(GetProcessHeap(), 0, item.pszText); } /* Ensure that the previously selected item is selected again. */ if (lSelected >= 0) { item.mask = LVIF_STATE; item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED; SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMSTATE, lSelected, (LPARAM)&item); } }
static void init_shell_folder_listview_headers(HWND dialog) { LVCOLUMNW listColumn; RECT viewRect; WCHAR szShellFolder[64] = {'S','h','e','l','l',' ','F','o','l','d','e','r',0}; WCHAR szLinksTo[64] = {'L','i','n','k','s',' ','t','o',0}; int width; LoadStringW(GetModuleHandleW(NULL), IDS_SHELL_FOLDER, szShellFolder, sizeof(szShellFolder)/sizeof(WCHAR)); LoadStringW(GetModuleHandleW(NULL), IDS_LINKS_TO, szLinksTo, sizeof(szLinksTo)/sizeof(WCHAR)); GetClientRect(GetDlgItem(dialog, IDC_LIST_SFPATHS), &viewRect); width = (viewRect.right - viewRect.left) / 3; listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; listColumn.pszText = szShellFolder; listColumn.cchTextMax = strlenW(listColumn.pszText); listColumn.cx = width; SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn); listColumn.pszText = szLinksTo; listColumn.cchTextMax = strlenW(listColumn.pszText); listColumn.cx = viewRect.right - viewRect.left - width - 1; SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTCOLUMNW, 1, (LPARAM) &listColumn); }
static void on_remove_click(HWND dialog) { int sel = SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); struct dll *dll; if (sel == LB_ERR) return; dll = (struct dll *) SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, sel, 0); SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_DELETESTRING, sel, 0); SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0); set_reg_key(config_key, keypath("DllOverrides"), dll->name, NULL); HeapFree(GetProcessHeap(), 0, dll->name); HeapFree(GetProcessHeap(), 0, dll); if (SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0) > 0) SendDlgItemMessageW(dialog, IDC_DLLS_LIST, LB_SETCURSEL, max(sel - 1, 0), 0); else { disable(IDC_DLLS_EDITDLL); disable(IDC_DLLS_REMOVEDLL); } set_controls_from_selection(dialog); }
static VOID InitPmSymbol( HWND hwndDlg, PGLOBALDATA pGlobalData) { int nLen; SendDlgItemMessageW(hwndDlg, IDC_TIMEPMSYMBOL, CB_LIMITTEXT, MAX_TIMEPMSYMBOL, 0); nLen = wcslen(pGlobalData->szTimeAM); SendDlgItemMessageW(hwndDlg, IDC_TIMEPMSYMBOL, CB_ADDSTRING, 0, (LPARAM)pGlobalData->szTimePM); if (nLen != 0) { SendDlgItemMessageW(hwndDlg, IDC_TIMEPMSYMBOL, CB_ADDSTRING, 0, (LPARAM)L""); } SendDlgItemMessageW(hwndDlg, IDC_TIMEPMSYMBOL, CB_SETCURSEL, 0, /* Index */ 0); }
static void initialize_disabled_joysticks_list(HWND hwnd) { static const WCHAR disabled_str[] = {'d','i','s','a','b','l','e','d','\0'}; HKEY hkey, appkey; DWORD values = 0; HRESULT hr; DWORD i; SendDlgItemMessageW(hwnd, IDC_DISABLEDLIST, LB_RESETCONTENT, 0, 0); /* Search for disabled joysticks */ get_app_key(&hkey, &appkey); RegQueryInfoKeyW(hkey, NULL, NULL, NULL, NULL, NULL, NULL, &values, NULL, NULL, NULL, NULL); for (i=0; i < values; i++) { DWORD name_len = MAX_PATH, data_len = MAX_PATH; WCHAR buf_name[MAX_PATH + 9], buf_data[MAX_PATH]; hr = RegEnumValueW(hkey, i, buf_name, &name_len, NULL, NULL, (BYTE*) buf_data, &data_len); if (SUCCEEDED(hr) && !lstrcmpW(disabled_str, buf_data)) SendDlgItemMessageW(hwnd, IDC_DISABLEDLIST, LB_ADDSTRING, 0, (LPARAM) buf_name); } if (hkey) RegCloseKey(hkey); if (appkey) RegCloseKey(appkey); }
/// <summary> /// Set the status bar message /// </summary> /// <param name="szMessage">message to display</param> void CKinectFusionExplorer::SetStatusMessage(const WCHAR * szMessage) { size_t length = 0; if (FAILED(StringCchLength( szMessage, KinectFusionProcessorFrame::StatusMessageMaxLen, &length))) { length = 0; } if (length > 0) { SendDlgItemMessageW(m_hWnd, IDC_STATUS, WM_SETTEXT, 0, (LPARAM)szMessage); m_tickLastStatus = GetTickCount(); } else { // Clear the status message after a timeout (as long as frames are flowing) if (GetTickCount() - m_tickLastStatus > cStatusTimeoutInMilliseconds && m_fFramesPerSecond > 0) { SendDlgItemMessageW(m_hWnd, IDC_STATUS, WM_SETTEXT, 0, 0); m_tickLastStatus = GetTickCount(); } } }
static BOOL Spelling_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { PSUGGARRAY psa = (PSUGGARRAY)lParam; int index; wchar_t szBuffer[512]; g_hSpellChecking = hwnd; if(psa->pSuggs){ SetPropW(hwnd, EDIT_PROP, (HANDLE)psa->hEdit); for(int i = 0; i < psa->count; i++){ index = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_ADDSTRING, 0, (LPARAM)psa->pSuggs[i]->word); SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_SETITEMDATA, index, (LPARAM)psa->pSuggs[i]); } } GetPrivateProfileStringW(L"options", L"1052", L"Spell checking", szBuffer, 256, g_NotePaths.CurrLanguagePath); SetWindowTextW(hwnd, szBuffer); SetDlgCtlText(hwnd, IDCANCEL, g_NotePaths.CurrLanguagePath, L"Cancel"); SetDlgCtlText(hwnd, IDC_ST_NOT_IN_DICT, g_NotePaths.CurrLanguagePath, L"Not in dictionary"); SetDlgCtlText(hwnd, IDC_ST_SUGGESTIONS, g_NotePaths.CurrLanguagePath, L"Suggestions"); SetDlgCtlText(hwnd, IDC_CMD_IGNORE_ONCE, g_NotePaths.CurrLanguagePath, L"Ignore once"); SetDlgCtlText(hwnd, IDC_CMD_IGNORE_ALL, g_NotePaths.CurrLanguagePath, L"Ignore all"); SetDlgCtlText(hwnd, IDC_CMD_ADD_TO_DICT, g_NotePaths.CurrLanguagePath, L"Add to dictionary"); SetDlgCtlText(hwnd, IDC_CMD_CHANGE_ONCE, g_NotePaths.CurrLanguagePath, L"Change"); SetDlgCtlText(hwnd, IDC_CMD_CHANGE_ALL, g_NotePaths.CurrLanguagePath, L"Change all"); return TRUE; }
static void on_sysparam_change(HWND hDlg) { int index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETCURSEL, 0, 0); index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETITEMDATA, index, 0); updating_ui = TRUE; EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_COLOR_TEXT), metrics[index].color_idx != -1); EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_COLOR), metrics[index].color_idx != -1); InvalidateRect(GetDlgItem(hDlg, IDC_SYSPARAM_COLOR), NULL, TRUE); EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_SIZE_TEXT), metrics[index].sm_idx != -1); EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_SIZE), metrics[index].sm_idx != -1); EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_SIZE_UD), metrics[index].sm_idx != -1); if (metrics[index].sm_idx != -1) SendDlgItemMessageW(hDlg, IDC_SYSPARAM_SIZE_UD, UDM_SETPOS, 0, MAKELONG(metrics[index].size, 0)); else set_text(hDlg, IDC_SYSPARAM_SIZE, ""); EnableWindow(GetDlgItem(hDlg, IDC_SYSPARAM_FONT), index == IDC_SYSPARAMS_MENU_TEXT-IDC_SYSPARAMS_BUTTON || index == IDC_SYSPARAMS_ACTIVE_TITLE_TEXT-IDC_SYSPARAMS_BUTTON || index == IDC_SYSPARAMS_TOOLTIP_TEXT-IDC_SYSPARAMS_BUTTON || index == IDC_SYSPARAMS_MSGBOX_TEXT-IDC_SYSPARAMS_BUTTON ); updating_ui = FALSE; }
static BOOL OnInitDialog(HWND hwndDlg) { DWORD dwWaitInterval; DPRINT("OnInitDialog()\n"); SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFUP), BM_SETIMAGE,(WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_UP))); SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFDWN), BM_SETIMAGE,(WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_DOWN))); if (!GetProfiles(hwndDlg)) return FALSE; SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG((SHORT)500, 0)); dwWaitInterval = GetUserWaitInterval(); if (dwWaitInterval == (DWORD)-1) { CheckDlgButton(hwndDlg, IDC_HRDPROFWAIT, BST_CHECKED); SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETPOS, 0, 30); EnableWindow(GetDlgItem(hwndDlg, IDC_HRDPROFEDIT), FALSE); } else { CheckDlgButton(hwndDlg, IDC_HRDPROFSELECT, BST_CHECKED); SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETPOS, 0, dwWaitInterval); } return TRUE; }
static VOID MoveHardwareProfile( HWND hwndDlg, PPROFILEDATA pProfileData, BOOL bMoveUp) { PROFILE TempProfile; PPROFILE pSrcProfile, pDstProfile; DWORD dwSrcIndex, dwDstIndex; dwSrcIndex = pProfileData->dwSelectedProfileIndex; dwDstIndex = bMoveUp ? (dwSrcIndex - 1) : (dwSrcIndex + 1); pSrcProfile = &pProfileData->pProfiles[dwSrcIndex]; pDstProfile = &pProfileData->pProfiles[dwDstIndex]; CopyMemory(&TempProfile, pDstProfile, sizeof(PROFILE)); CopyMemory(pDstProfile, pSrcProfile, sizeof(PROFILE)); CopyMemory(pSrcProfile, &TempProfile, sizeof(PROFILE)); SendDlgItemMessageW(hwndDlg, IDC_HRDPROFLSTBOX, LB_DELETESTRING, dwSrcIndex, 0); SendDlgItemMessageW(hwndDlg, IDC_HRDPROFLSTBOX, LB_INSERTSTRING, dwDstIndex, (LPARAM)pDstProfile->szFriendlyName); pProfileData->dwSelectedProfileIndex = dwDstIndex; SendDlgItemMessageW(hwndDlg, IDC_HRDPROFLSTBOX, LB_SETCURSEL, pProfileData->dwSelectedProfileIndex, 0); UpdateButtons(hwndDlg, pProfileData); }
static void FindByDates(HWND hwnd){ SYSTEMTIME stFrom = {0}, stTo = {0}, stf = {0}, stt = {0}; PMEMNOTE pNote = NULL; HWND hTree = GetDlgItem(hwnd, IDC_TVW_SEARCH_DATES); BOOL fCheckDeleted = CTreeView_GetCheckBoxState(hTree, m_ChecksTDSearch[sdDeleted]); BOOL fCheckCreated = CTreeView_GetCheckBoxState(hTree, m_ChecksTDSearch[sdCreation]); BOOL fCheckSaved = CTreeView_GetCheckBoxState(hTree, m_ChecksTDSearch[sdSaved]); BOOL fCheckSent = CTreeView_GetCheckBoxState(hTree, m_ChecksTDSearch[sdSent]); BOOL fCheckReceived = CTreeView_GetCheckBoxState(hTree, m_ChecksTDSearch[sdReceived]); BOOL fInsert; ListView_DeleteAllItems(m_hListResults); SendDlgItemMessageW(hwnd, IDC_CAL_SEARCH_FROM, DTM_GETSYSTEMTIME, 0, (LPARAM)&stf); SendDlgItemMessageW(hwnd, IDC_CAL_SEARCH_TO, DTM_GETSYSTEMTIME, 0, (LPARAM)&stt); stFrom.wYear = stf.wYear; stFrom.wMonth = stf.wMonth; stFrom.wDay = stf.wDay; stFrom.wDayOfWeek = stf.wDayOfWeek; stTo.wYear = stt.wYear; stTo.wMonth = stt.wMonth; stTo.wDay = stt.wDay; stTo.wDayOfWeek = stt.wDayOfWeek; stTo.wHour = 23; stTo.wMinute = 59; stTo.wSecond = 59; stTo.wMilliseconds = 0; pNote = MemoryNotes(); while(pNote){ fInsert = FALSE; if(pNote->pData->idGroup == GROUP_RECYCLE && !fCheckDeleted) goto __next; if(fCheckCreated && IsDateInRange(&stFrom, &stTo, pNote->pCreated)){ fInsert = TRUE; goto __next; } if(fCheckSaved && IsDateInRange(&stFrom, &stTo, &pNote->pData->stChanged)){ fInsert = TRUE; goto __next; } if(fCheckSent && IsDateInRange(&stFrom, &stTo, &pNote->pSRStatus->lastSent)){ fInsert = TRUE; goto __next; } if(fCheckReceived && IsDateInRange(&stFrom, &stTo, &pNote->pSRStatus->lastRec)){ fInsert = TRUE; goto __next; } if(fCheckDeleted && IsDateInRange(&stFrom, &stTo, pNote->pRealDeleted)){ fInsert = TRUE; goto __next; } __next: if(fInsert){ InsertNoteIntoResultList(hwnd, pNote); } pNote = pNote->next; } SendMessageW(m_hListResults, LVM_SORTITEMSEX, LVS_SORTASCENDING, (LPARAM)NameCompareFunc); }
static void _clearSuggestions(HWND hwnd){ int count = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETCOUNT, 0, 0); for(int i = 0; i < count; i++){ PSUGGESTION ps = (PSUGGESTION)SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETITEMDATA, i, 0); _freeSuggestions(&ps); } RemovePropW(hwnd, EDIT_PROP); }
static void _ignoreOnce(HWND hwnd){ int index, count; index = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETCURSEL, 0, 0); count = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETCOUNT, 0, 0); if(index == LB_ERR) return; _removeEntry(hwnd, index, count); }
static void ff_handle_joychange(HWND hwnd, struct JoystickData *data) { int sel; if (data->num_ff == 0) return; sel = SendDlgItemMessageW(hwnd, IDC_FFSELECTCOMBO, CB_GETCURSEL, 0, 0); data->chosen_joystick = SendDlgItemMessageW(hwnd, IDC_FFSELECTCOMBO, CB_GETITEMDATA, sel, 0); initialize_effects_list(hwnd, &data->joysticks[data->chosen_joystick]); }
static VOID DeleteHardwareProfile( HWND hwndDlg, PPROFILEDATA pProfileData) { WCHAR szMessage[256]; WCHAR szBuffer[128]; WCHAR szCaption[80]; PPROFILE pProfiles; PPROFILE pProfile; pProfile = &pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex]; LoadStringW(hApplet, IDS_HWPROFILE_CONFIRM_DELETE_TITLE, szCaption, sizeof(szCaption) / sizeof(WCHAR)); LoadStringW(hApplet, IDS_HWPROFILE_CONFIRM_DELETE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)); swprintf(szMessage, szBuffer, pProfile->szFriendlyName); if (MessageBox(NULL, szMessage, szCaption, MB_YESNO | MB_ICONQUESTION) != IDYES) return; SendDlgItemMessageW(hwndDlg, IDC_HRDPROFLSTBOX, LB_DELETESTRING, pProfileData->dwSelectedProfileIndex, 0); if (pProfileData->dwSelectedProfileIndex != pProfileData->dwProfileCount - 1) { RtlMoveMemory(&pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex], &pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex + 1], (pProfileData->dwProfileCount - pProfileData->dwSelectedProfileIndex - 1) * sizeof(PPROFILE)); } else { pProfileData->dwSelectedProfileIndex--; } pProfiles = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pProfileData->pProfiles, (pProfileData->dwProfileCount - 1) * sizeof(PROFILE)); if (pProfiles == NULL) { DPRINT1("HeapReAlloc() failed!\n"); return; } pProfileData->dwProfileCount--; pProfileData->pProfiles = pProfiles; SendDlgItemMessageW(hwndDlg, IDC_HRDPROFLSTBOX, LB_SETCURSEL, pProfileData->dwSelectedProfileIndex, 0); UpdateButtons(hwndDlg, pProfileData); }
static void SetListColumnText(HWND hwnd, int listID, int index, wchar_t * lpKey, wchar_t * lpDefault, wchar_t * lpFile){ LVCOLUMNW lvc = {0}; wchar_t szBuffer[256]; lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH; lvc.cchTextMax = 256; lvc.pszText = szBuffer; SendDlgItemMessageW(hwnd, listID, LVM_GETCOLUMNW, index, (LPARAM)&lvc); GetPrivateProfileStringW(S_COLUMNS, lpKey, lpDefault, szBuffer, 256, lpFile); SendDlgItemMessageW(hwnd, listID, LVM_SETCOLUMNW, index, (LPARAM)&lvc); }
/*********************************************************************** * FD31_UpdateFileTitle [internal] * update the displayed file name (without path) */ static void FD31_UpdateFileTitle(PFD31_DATA lfs) { LONG lRet; LPOPENFILENAMEW ofnW = lfs->ofnW; if (ofnW->lpstrFileTitle != NULL) { lRet = SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0); SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETTEXT, lRet, (LPARAM)ofnW->lpstrFileTitle ); lfs->callbacks->UpdateFileTitle(lfs); } }
INT_PTR CALLBACK SessionDialogProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { SESSION_DATA *pSD; pSD = (SESSION_DATA *)GetWindowLongPtr(hwndDlg, DWLP_USER); switch (uMsg) { case WM_INITDIALOG: { // Store the SESSION_DATA pointer in the // window's user data SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); pSD = (SESSION_DATA *)lParam; // Populate the session text SendDlgItemMessageW(hwndDlg, IDC_STATIC_SESSION_NAME, WM_SETTEXT, 0, (LPARAM)(pSD->bstrName)); SendDlgItemMessageW(hwndDlg, IDC_STATIC_SESSION_URI, WM_SETTEXT, 0, (LPARAM)(pSD->bstrURI)); } return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_BUTTON_SESSION_ACCEPT: { pSD->fAccept = TRUE; EndDialog(hwndDlg, IDOK); } return TRUE; case IDC_BUTTON_SESSION_REJECT: case IDCANCEL: { pSD->fAccept = FALSE; EndDialog(hwndDlg, IDOK); } return TRUE; } } return FALSE; }
static INT_PTR CALLBACK ChangePasswordDialogProc( IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) { PGINA_CONTEXT pgContext; pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA); switch (uMsg) { case WM_INITDIALOG: pgContext = (PGINA_CONTEXT)lParam; SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_USERNAME, pgContext->UserName); SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain); SendDlgItemMessageW(hwndDlg, IDC_CHANGEPWD_DOMAIN, CB_SETCURSEL, 0, 0); SetFocus(GetDlgItem(hwndDlg, IDC_CHANGEPWD_OLDPWD)); return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: if (DoChangePassword(pgContext, hwndDlg)) { EndDialog(hwndDlg, TRUE); } else { SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD1, NULL); SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD2, NULL); SetFocus(GetDlgItem(hwndDlg, IDC_CHANGEPWD_OLDPWD)); } return TRUE; case IDCANCEL: EndDialog(hwndDlg, FALSE); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, FALSE); return TRUE; } return FALSE; }
static void initialize_effects_list(HWND hwnd, struct Joystick* joy) { int i; SendDlgItemMessageW(hwnd, IDC_FFEFFECTLIST, LB_RESETCONTENT, 0, 0); for (i=0; i < joy->num_effects; i++) { /* Effect names start with GUID_, so we'll skip this part */ WCHAR *name = joy->effects[i].info.tszName + 5; SendDlgItemMessageW(hwnd, IDC_FFEFFECTLIST, LB_ADDSTRING, 0, (LPARAM) name); } }
static void initialize_joysticks_list(HWND hwnd, struct JoystickData *data) { int i; SendDlgItemMessageW(hwnd, IDC_JOYSTICKLIST, LB_RESETCONTENT, 0, 0); /* Add enumerated joysticks */ for (i = 0; i < data->num_joysticks; i++) { struct Joystick *joy = &data->joysticks[i]; SendDlgItemMessageW(hwnd, IDC_JOYSTICKLIST, LB_ADDSTRING, 0, (LPARAM) joy->instance.tszInstanceName); } }
/*********************************************************************** * FD31_FileTypeChange [internal] * called when a new item is picked in the file type combo */ static LRESULT FD31_FileTypeChange( const FD31_DATA *lfs ) { LONG lRet; LPWSTR pstr; lRet = SendDlgItemMessageW(lfs->hwnd, cmb1, CB_GETCURSEL, 0, 0); if (lRet == LB_ERR) return TRUE; pstr = (LPWSTR)SendDlgItemMessageW(lfs->hwnd, cmb1, CB_GETITEMDATA, lRet, 0); TRACE("Selected filter : %s\n", debugstr_w(pstr)); return FD31_Validate( lfs, NULL, cmb1, lRet, TRUE ); }
static VOID GeneralOnInit(HWND hwnd, PINFO pInfo) { SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)pInfo); pInfo->hGeneralPage = hwnd; SetWindowPos(pInfo->hGeneralPage, NULL, 2, 22, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); pInfo->hLogon = LoadImageW(hInst, MAKEINTRESOURCEW(IDI_LOGON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); if (pInfo->hLogon) { SendDlgItemMessageW(pInfo->hGeneralPage, IDC_LOGONICON, STM_SETICON, (WPARAM)pInfo->hLogon, 0); } pInfo->hConn = LoadImageW(hInst, MAKEINTRESOURCEW(IDI_CONN), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); if (pInfo->hConn) { SendDlgItemMessageW(pInfo->hGeneralPage, IDC_CONNICON, STM_SETICON, (WPARAM)pInfo->hConn, 0); } FillServerAddressCombo(pInfo); ReLoadGeneralPage(pInfo); }
static VOID OnResolutionChanged(PINFO pInfo, INT position) { WCHAR Buffer[64]; INT MaxSlider; MaxSlider = SendDlgItemMessageW(pInfo->hDisplayPage, IDC_GEOSLIDER, TBM_GETRANGEMAX, 0, 0); if (position == MaxSlider) { LoadStringW(hInst, IDS_FULLSCREEN, Buffer, sizeof(Buffer) / sizeof(WCHAR)); } else { WCHAR Pixel[64]; if (LoadStringW(hInst, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(WCHAR))) { #ifdef _MSC_VER _swprintf(Buffer, Pixel, pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, Pixel); #else swprintf(Buffer, Pixel, pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, Pixel); #endif } } SendDlgItemMessageW(pInfo->hDisplayPage, IDC_SETTINGS_RESOLUTION_TEXT, WM_SETTEXT, 0, (LPARAM)Buffer); }
static void _replaceOnce(HWND hwnd){ int index1, index2, count; HWND hEdit = (HWND)GetPropW(hwnd, EDIT_PROP); PSUGGESTION ps; count = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETCOUNT, 0, 0); index1 = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETCURSEL, 0, 0); index2 = SendDlgItemMessageW(hwnd, IDC_LST_SUGGESTIONS, LB_GETCURSEL, 0, 0); if(index1 == LB_ERR || index2 == LB_ERR) return; ps = (PSUGGESTION)SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_GETITEMDATA, index1, 0); _replaceInEdit(hwnd, hEdit, ps, index1, index2, count); _removeEntry(hwnd, index1, count); }
// // Post-processing step for each dialog item. // Static controls and buttons: change text and bitmaps. // Listboxes and combo boxes: ensures that the selected item is visible. // static void FixupDialogItem( HINSTANCE hInst, HWND hDlg, LPDLGITEMTEMPLATE lpDlgItem, LPWORD lpClass, LPWORD lpData) { if (lpClass[0] == 0xFFFF) { switch (lpClass[1]) { case 0x0080: // button case 0x0082: // static { if (lpData[0] == 0xFFFF) { if (lpDlgItem->style & SS_ICON) { HICON hOld = (HICON)SendDlgItemMessageW(hDlg, lpDlgItem->id, STM_GETIMAGE, IMAGE_ICON, 0); HICON hNew = LoadIcon(hInst, MAKEINTRESOURCE(lpData[1])); SendDlgItemMessageW(hDlg, lpDlgItem->id, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hNew); DestroyIcon(hOld); } else if (lpDlgItem->style & SS_BITMAP) { HBITMAP hOld = (HBITMAP)SendDlgItemMessageW(hDlg, lpDlgItem->id, STM_GETIMAGE, IMAGE_BITMAP, 0); HBITMAP hNew = LoadBitmap(hInst, MAKEINTRESOURCE(lpData[1])); SendDlgItemMessageW(hDlg, lpDlgItem->id, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hNew); DeleteObject(hOld); } } else // lpData[0] is not 0xFFFF (it's text). { SetDlgItemTextW(hDlg, lpDlgItem->id, (LPCTSTR)lpData); } } break; case 0x0083: // list box { INT nSel = SendDlgItemMessageW(hDlg, lpDlgItem->id, LB_GETCURSEL, 0, 0); if (nSel != LB_ERR) { SendDlgItemMessageW(hDlg, lpDlgItem->id, LB_SETCURSEL, nSel, 0); } } break; case 0x0085: // combo box { INT nSel = SendDlgItemMessageW(hDlg, lpDlgItem->id, CB_GETCURSEL, 0, 0); if (nSel != CB_ERR) { SendDlgItemMessageW(hDlg, lpDlgItem->id, CB_SETCURSEL, nSel, 0); } } break; } } }
static BOOL SearchDates_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { wchar_t szDFormat[128], szTFormat[128]; g_hSearchDates = hwnd; CenterWindow(hwnd, FALSE); m_hListResults = GetDlgItem(hwnd, IDC_LST_RESULTS); PrepareResultsList(hwnd); ApplySearchDatesLanguage(hwnd); ParseDateFormat(g_DTFormats.DateFormat, szDFormat, szTFormat); SendDlgItemMessageW(hwnd, IDC_CAL_SEARCH_FROM, DTM_SETFORMATW, 0, (LPARAM)szDFormat); SendDlgItemMessageW(hwnd, IDC_CAL_SEARCH_TO, DTM_SETFORMATW, 0, (LPARAM)szDFormat); return FALSE; }