static void ConsoleWndAllUpdate(void) { ConsoleWndVerbosityUpdate(); ConsoleWndValidUpdate(); Edit_LimitText(GetDlgItem(hConsoleWnd,IDC_EDIT_VERBOSITY),3); Edit_LimitText(GetDlgItem(hConsoleWnd,IDC_EDIT),ConsoleWndMaxSize); }
/* * GroupDialogProc: Dialog procedure for group dialog. */ BOOL CALLBACK GroupDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) { int i, index; HWND hList, hCombo; list_type l; switch (message) { case WM_INITDIALOG: // Add groups to list box hCombo = GetDlgItem(hDlg, IDC_GROUPS); SetWindowFont(hCombo, GetFont(FONT_LIST), FALSE); for (i=0; i < num_groups; i++) index = ComboBox_AddString(hCombo, groups[i]); // Add logged on users to list box hList = GetDlgItem(hDlg, IDC_LOGGEDON); SetWindowFont(hList, GetFont(FONT_LIST), FALSE); for (l = *(cinfo->current_users); l != NULL; l = l->next) { object_node *obj = (object_node *) (l->data); ListBox_AddString(hList, LookupNameRsc(obj->name_res)); } PostMessage(hDlg, BK_CREATED, 0, 0); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPMEMBERS), GetFont(FONT_LIST), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_ADDNAME), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_NEWGROUP), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPTELL), GetFont(FONT_EDIT), FALSE); Edit_LimitText(GetDlgItem(hDlg, IDC_NEWGROUP), MAX_GROUPNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_ADDNAME), MAX_CHARNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_GROUPTELL), MAXSAY); if (num_groups >= MAX_NUMGROUPS) EnableWindow(GetDlgItem(hDlg, IDC_NEWGROUP), FALSE); hGroupDialog = hDlg; CenterWindow(hDlg, GetParent(hDlg)); return TRUE; case BK_CREATED: hCombo = GetDlgItem(hDlg, IDC_GROUPS); ComboBox_SetCurSel(hCombo, 0); // Need this for some reason to simulate WM_COMMAND GroupCommand(hDlg, IDC_GROUPS, hCombo, CBN_SELCHANGE); return TRUE; HANDLE_MSG(hDlg, WM_COMMAND, GroupCommand); case WM_DRAWITEM: // windowsx.h macro always returns FALSE return GroupListDrawItem(hDlg, (const DRAWITEMSTRUCT *)(lParam)); case WM_DESTROY: hGroupDialog = NULL; return TRUE; } return FALSE; }
ATMO_BOOL CDmxConfigDialog::InitDialog(WPARAM wParam) { m_hCbxComports = getDlgItem(IDC_COMPORT); InitDialog_ComPorts( m_hCbxComports ); int com = m_pConfig->getComport() - 1; if(com < 0) com = 0; ComboBox_SetCurSel(m_hCbxComports, com); m_hCbxBaudrate = getDlgItem(IDC_BAUDRATE); ComboBox_AddString(m_hCbxBaudrate, "115200"); ComboBox_AddString(m_hCbxBaudrate, "250000"); ComboBox_SetCurSel(m_hCbxBaudrate, m_pConfig->getDMX_BaudrateIndex()); char buf[10]; HWND control; control = getDlgItem(IDC_EDT_DMX_BASE); Edit_LimitText( control , 256); Edit_SetText(control, m_pConfig->getDMX_BaseChannels() ); control = getDlgItem(IDC_EDT_DMX_RGB); Edit_LimitText(control, 2); sprintf(buf,"%d",m_pConfig->getDMX_RGB_Channels()); Edit_SetText(control, buf); return ATMO_FALSE; }
BOOL EditItem_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { INT i; CHAR szBuf[128]; HWND hwndCtrl; nListContent = -1; hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_PIXEL_SIZE ); Edit_LimitText( hwndCtrl, 8 ); hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_NAME ); Edit_LimitText( hwndCtrl, 30 ); hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_TYPE ); for( i = 0; i < NUM_ITEM_TYPES; ++i ) { ComboBox_AddString( hwndCtrl, GetItemTypeString( i ) ); } ComboBox_SetCurSel( hwndCtrl, nNewItemType ); DoubleToString( szBuf, dNewPixelSize, 2 ); Edit_SetText( GetDlgItem( hwnd, IDC_EDIT_ITEM_PIXEL_SIZE ), szBuf ); Edit_SetText( GetDlgItem( hwnd, IDC_EDIT_ITEM_NAME ), szNewItemName ); EditItem_TypeChanged( hwnd ); AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // EditItem_OnInitDialog
BOOL EditNoise_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { CHAR szBuf[128]; HWND hwndCtrl; hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_NAME); Edit_LimitText(hwndCtrl, 30); Edit_SetText(hwndCtrl, szNewNoiseName); hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_RADIUS); Edit_LimitText(hwndCtrl, 8); DoubleToString(szBuf, dNewRadius, 0); Edit_SetText(hwndCtrl, szBuf); hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_HEIGHT); Edit_LimitText(hwndCtrl, 8); DoubleToString(szBuf, dNewHeight, 0); Edit_SetText(hwndCtrl, szBuf); hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_DELAY); Edit_LimitText(hwndCtrl, 8); wsprintf(szBuf, "%d", nNewDelay); Edit_SetText(hwndCtrl, szBuf); EditNoise_InitList(hwnd); AllDialogs_OnInitDialog(hwnd, hwndFocus, lParam); return TRUE; } // EditNoise_OnInitDialog
ATMO_BOOL CAtmoColorPicker::InitDialog(WPARAM wParam) { CLanguage *Lng = new CLanguage; HWND hwndCtrl; hwndCtrl = this->getDlgItem(IDC_EDT_RED); Edit_LimitText(hwndCtrl,3); hwndCtrl = this->getDlgItem(IDC_EDT_GREEN); Edit_LimitText(hwndCtrl,3); hwndCtrl = this->getDlgItem(IDC_EDT_BLUE); Edit_LimitText(hwndCtrl,3); hwndCtrl = this->getDlgItem(IDC_SL_RED); SendMessage(hwndCtrl, TBM_SETRANGEMIN, 0, 0); SendMessage(hwndCtrl, TBM_SETRANGEMAX, 0, 255); SendMessage(hwndCtrl, TBM_SETPOS, 1, this->m_iRed); SendMessage(hwndCtrl, TBM_SETTICFREQ, 8, 0); hwndCtrl = this->getDlgItem(IDC_SL_GREEN); SendMessage(hwndCtrl, TBM_SETRANGEMIN, 0, 0); SendMessage(hwndCtrl, TBM_SETRANGEMAX, 0, 255); SendMessage(hwndCtrl, TBM_SETPOS, 1, this->m_iGreen); SendMessage(hwndCtrl, TBM_SETTICFREQ, 8, 0); hwndCtrl = this->getDlgItem(IDC_SL_BLUE); SendMessage(hwndCtrl, TBM_SETRANGEMIN, 0, 0); SendMessage(hwndCtrl, TBM_SETRANGEMAX, 0, 255); SendMessage(hwndCtrl, TBM_SETPOS, 1, this->m_iBlue); SendMessage(hwndCtrl, TBM_SETTICFREQ, 8, 0); UpdateColorControls(ATMO_TRUE, ATMO_TRUE); Lng->szCurrentDir[Lng->SetLngPath()]; sprintf(Lng->szFileINI, "%s\\Language.ini\0", Lng->szCurrentDir); GetPrivateProfileString("Common", "Language", "English", Lng->szLang, 256, Lng->szFileINI); // Read Buffer from IniFile sprintf(Lng->szTemp, "%s\\%s.xml\0", Lng->szCurrentDir, Lng->szLang); Lng->XMLParse(Lng->szTemp, Lng->sTextCPicker, "ColorPicker"); SendMessage(getDlgItem(IDC_STATIC22), WM_SETTEXT, 0, (LPARAM)(LPCTSTR)(Lng->sTextCPicker[0])); SendMessage(getDlgItem(IDC_STATIC23), WM_SETTEXT, 0, (LPARAM)(LPCTSTR)(Lng->sTextCPicker[1])); SendMessage(getDlgItem(IDC_STATIC24), WM_SETTEXT, 0, (LPARAM)(LPCTSTR)(Lng->sTextCPicker[2])); SendMessage(this->m_hDialog, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)(Lng->sTextCPicker[3])); SendMessage(getDlgItem(IDCANCEL), WM_SETTEXT, 0, (LPARAM)(LPCTSTR)(Lng->sTextCPicker[4])); return ATMO_TRUE; }
BOOL EditTrigger_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { CHAR szBuf[128]; HWND hwndCtrl; hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_TRIGGER_NAME ); Edit_LimitText( hwndCtrl, 30 ); Edit_SetText( hwndCtrl, szNewTriggerName ); hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_TRIGGER_RADIUS ); Edit_LimitText( hwndCtrl, 8 ); DoubleToString( szBuf, dNewRadius, 0 ); Edit_SetText( hwndCtrl, szBuf ); hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_TRIGGER_HEIGHT ); Edit_LimitText( hwndCtrl, 8 ); DoubleToString( szBuf, dNewHeight, 0 ); Edit_SetText( hwndCtrl, szBuf ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_PROXIMITY, (wNewFlags & TF_PROXIMITY_TRIGGER) ? 1 : 0 ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_USER, (wNewFlags & TF_USER_TRIGGER) ? 1 : 0 ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_ITEM_REQUIRED, (wNewFlags & TF_ITEM_REQUIRED) ? 1 : 0 ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_SOUND, (wNewFlags & TF_SOUND) ? 1 : 0 ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_END_LEVEL, (wNewFlags & TF_END_LEVEL) ? 1 : 0 ); CheckDlgButton( hwnd, IDC_EDIT_TRIGGER_END_GAME, (wNewFlags & TF_END_GAME) ? 1 : 0 ); nListContent = 0; EditTrigger_InitList( hwnd ); AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // EditTrigger_OnInitDialog
/* This function handles the WM_INITDIALOG message. */ BOOL FASTCALL RASBlinkProperties_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { LPCAMPROPSHEETPAGE psp; LPBLINKENTRY lpbe; HWND hwndList; HWND hwndEdit; /* Dereference and save the handle of the database, folder * or topic whose properties we're showing. */ psp = (LPCAMPROPSHEETPAGE)lParam; lpbe = (LPVOID)psp->lParam; SetWindowLong( hwnd, DWL_USER, (LPARAM)lpbe ); /* Set Use Ras checkbox. */ CheckDlgButton( hwnd, IDD_USERAS, lpbe->rd.fUseRAS ); /* Set flag indicating that the combo box has not been * filled with the RAS connections. */ hwndList = GetDlgItem( hwnd, IDD_LIST ); ComboBox_AddString( hwndList, lpbe->rd.szRASEntryName ); ComboBox_SetCurSel( hwndList, 0 ); fRasFill = FALSE; /* Show current user name and password. */ hwndEdit = GetDlgItem( hwnd, IDD_USERNAME ); Edit_SetText( hwndEdit, lpbe->rd.szRASUserName ); Edit_LimitText( hwndEdit, UNLEN ); /* Show current password. */ hwndEdit = GetDlgItem( hwnd, IDD_PASSWORD ); Amuser_Decrypt( lpbe->rd.szRASPassword, rgEncodeKey ); Edit_LimitText( hwndEdit, PWLEN ); Edit_SetText( hwndEdit, lpbe->rd.szRASPassword ); Amuser_Encrypt( lpbe->rd.szRASPassword, rgEncodeKey ); /* Disable list box and label if RAS disabled. */ EnableControl( hwnd, IDD_PAD1, lpbe->rd.fUseRAS ); EnableControl( hwnd, IDD_PAD2, lpbe->rd.fUseRAS ); EnableControl( hwnd, IDD_PAD3, lpbe->rd.fUseRAS ); EnableControl( hwnd, IDD_LIST, lpbe->rd.fUseRAS ); EnableControl( hwnd, IDD_USERNAME, lpbe->rd.fUseRAS ); EnableControl( hwnd, IDD_PASSWORD, lpbe->rd.fUseRAS ); return( TRUE ); }
BOOL Dlg_OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam) { // We're not running, disable stop button. EnableWindow(GetDlgItem(hwnd, IDC_STOP), FALSE); // Limit inputs max. valid length. Edit_LimitText(GetDlgItem(hwnd, IDC_EDITPERIOD), 10); Edit_LimitText(GetDlgItem(hwnd, IDC_EDITSAMPLES), 5); // Allow output to be max. length. Edit_LimitText(GetDlgItem(hwnd, IDC_EDITREPORT), 0); return(TRUE); }
BOOL TabPage_6_OnInitDialog(HWND hDlg,WPARAM wParam,LPARAM lParm) { TabPage_6_FillComboBox(GetDlgItem(hDlg,ComboBoxID),Graph_Type); // 限定输入字符个数 Edit_LimitText(GetDlgItem(hDlg,EditControlID[1]),255); Edit_LimitText(GetDlgItem(hDlg,EditControlID[2]),5); Edit_LimitText(GetDlgItem(hDlg,EditControlID[3]),5); Button_SetCheck(GetDlgItem(hDlg,CheckBoxID),BST_CHECKED); Edit_SetReadOnly(GetDlgItem(hDlg,EditControlID[1]),TRUE); Edit_SetText(GetDlgItem(hDlg,EditControlID[0]),TEXT("数据输入")); return TRUE; }
/* This function handles the WM_INITDIALOG message. */ BOOL FASTCALL NewSig_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { Edit_LimitText( GetDlgItem( hwnd, IDD_EDIT ), 8 ); EnableControl( hwnd, IDOK, FALSE ); SetWindowLong( hwnd, DWL_USER, lParam ); return( TRUE ); }
void CEditWnd::Init(CEditUI* pOwner) { m_pOwner = pOwner; RECT rcPos = CalPos(); UINT uStyle = WS_CHILD | ES_AUTOHSCROLL; if (m_pOwner->IsPasswordMode()) uStyle |= ES_PASSWORD; Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE); Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar()); if (m_pOwner->IsPasswordMode()) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar()); Edit_SetText(m_hWnd, m_pOwner->GetText()); Edit_SetModify(m_hWnd, FALSE); SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0)); Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true); Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true); ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); ::SetFocus(m_hWnd); m_bInit = true; }
static void InitialiseEditControls (HWND hwnd) { HWND hwndStartTime = GetDlgItem(hwnd, IDC_STARTTIME); Edit_LimitText(hwndStartTime, MAXOBJECTNAME-1); }
/* This function handles the WM_INITDIALOG message. */ BOOL FASTCALL LocalTopic_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { HWND hwndList; HWND hwndEdit; CURMSG curmsg; int index; /* Fill the listbox with the list of folders. */ hwndList = GetDlgItem( hwnd, IDD_LIST ); FillListWithFolders( hwnd, IDD_LIST ); /* Highlight the current folder or topic. */ Ameol2_GetCurrentTopic( &curmsg ); if( NULL != curmsg.pFolder ) { ASSERT( NULL != curmsg.pcat ); if( NULL == curmsg.pcl ) curmsg.pcl = Amdb_GetFirstFolder( curmsg.pcat ); if( CB_ERR != ( index = ComboBox_FindStringExact( hwndList, -1, curmsg.pcl ) ) ) ComboBox_SetCurSel( hwndList, index ); } /* Limit the input field. */ VERIFY( hwndEdit = GetDlgItem( hwnd, IDD_EDIT ) ); Edit_LimitText( hwndEdit, LEN_TOPICNAME ); EnableControl( hwnd, IDOK, FALSE ); SetFocus( hwndEdit ); return( FALSE ); }
BOOL ViewItems_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { INT i; HWND hwndCtrl; hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_LIST ); for( i = 0; i < po->nItems; ++i ) { ListBox_AddString( hwndCtrl, po->pItemData[i].item_name ); } ListBox_SetCurSel( hwndCtrl, 0 ); hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_TYPE ); Static_SetText( hwndCtrl, GetItemTypeString( po->pItemData[0].item_type ) ); hwndCtrl = GetDlgItem( hwnd, IDC_ITEM_PIXEL_SIZE ); Edit_LimitText( hwndCtrl, 8 ); ViewItems_ItemChanged( hwnd ); AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // ViewItems_OnInitDialog
BOOL PathSettings_OnInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam) { HWND hwnd = GetDlgItem(hDlg, IDC_PATHLIST); /* ComboBox_AddString(hwnd, ROMKEY); ComboBox_AddString(hwnd, BATTERYKEY); ComboBox_AddString(hwnd, STATEKEY); ComboBox_AddString(hwnd, SCREENSHOTKEY); ComboBox_AddString(hwnd, AVIKEY); ComboBox_AddString(hwnd, CHEATKEY); ComboBox_AddString(hwnd, SOUNDKEY); ComboBox_AddString(hwnd, FIRMWAREKEY); ComboBox_SetCurSel(hwnd, 0);*/ // PathSettings_OnSelChange(hDlg, NULL); associate = GetPrivateProfileInt(SECTION, ASSOCIATEKEY, 0, IniName); CheckDlgButton(hDlg, IDC_USELASTVISIT, (path.savelastromvisit) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hDlg, IDC_ASSOCIATE, (associate) ? BST_CHECKED : BST_UNCHECKED); CheckRadioButton(hDlg, IDC_PNG, IDC_BMP, (int)path.imageformat()); CheckRadioButton(hDlg, IDC_R4TYPE1, IDC_R4TYPE2, (int)path.r4Format); // IDC_FORMATEDIT setup SetDlgItemText(hDlg, IDC_FORMATEDIT, path.screenshotFormat); hwnd = GetDlgItem(hDlg, IDC_FORMATEDIT); Edit_LimitText(hwnd, MAX_FORMAT); HWND toolTip = CreateWindowExW(NULL, TOOLTIPS_CLASSW, NULL, TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hDlg, NULL, hAppInst, NULL); SendMessage(toolTip, TTM_SETMAXTIPWIDTH, NULL, (LPARAM)330); SetWindowPos(toolTip, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); SetDlgItemText(hDlg, IDC_ROMPATHEDIT, path.pathToRoms); SetDlgItemText(hDlg, IDC_SAVERAMPATHEDIT, path.pathToBattery); SetDlgItemText(hDlg, IDC_STATEPATHEDIT, path.pathToStates); SetDlgItemText(hDlg, IDC_SCREENSHOTPATHEDIT, path.pathToScreenshots); SetDlgItemText(hDlg, IDC_AVIPATHEDIT, path.pathToAviFiles); SetDlgItemText(hDlg, IDC_CHEATPATHEDIT, path.pathToCheats); SetDlgItemText(hDlg, IDC_LUAPATHEDIT, path.pathToLua); TOOLINFO ti; ZeroMemory(&ti, sizeof(ti)); ti.cbSize = sizeof(ti); ti.hwnd = hDlg; ti.hinst = hAppInst; ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; ti.uId = (UINT_PTR)hwnd; ti.lpszText = "The format a screenshot should be saved in.\r\n%f\t\t\tFilename\r\n%D\t\t\tDay:Two Digit\r\n%M\t\t\tMonth:Two Digit\r\n%Y\t\t\tYear:Four Digit\r\n%h\t\t\tHour:Two Digit\r\n%m\t\t\tMinute: Two Digit\r\n%s\t\t\tSecond: Two Digit\r\n%r\t\tRandom: Min:0 Max:RAND_MAX"; GetClientRect(hwnd, &ti.rect); SendMessage(toolTip, TTM_ADDTOOL, NULL, (LPARAM)&ti); return TRUE; }
void CPathEditWnd::Init( CPathEditUI* pOwner ) { m_pOwner = pOwner; RECT rcPos = CalPos(); UINT uStyle = WS_CHILD | ES_AUTOHSCROLL; if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD; Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); HFONT hFont=NULL; int iFontIndex=m_pOwner->GetFont(); if (iFontIndex!=-1) hFont=m_pOwner->GetManager()->GetFont(iFontIndex); if (hFont==NULL) hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont; SetWindowFont(m_hWnd, hFont, TRUE); Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar()); if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar()); Edit_SetText(m_hWnd, m_pOwner->GetText()); Edit_SetModify(m_hWnd, FALSE); SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0)); Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true); Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true); //Styls LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE); styleValue |= pOwner->GetWindowStyls(); ::SetWindowLong(GetHWND(), GWL_STYLE, styleValue); ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); ::SetFocus(m_hWnd); m_bInit = true; }
// Initialization void InitConsoleWnd(HWND hParentWnd) { if (hConsoleWnd != NULL) { DestroyWindow(hConsoleWnd); hConsoleWnd = NULL; } INILoadConsoleWnd(); switch(PlayerLanguage){ case LANGUAGE_ENGLISH: hConsoleWnd = CreateDialog (hInst,MAKEINTRESOURCE(IDD_DIALOG_CONSOLE_EN),hParentWnd,ConsoleWndProc); break; default: case LANGUAGE_JAPANESE: hConsoleWnd = CreateDialog (hInst,MAKEINTRESOURCE(IDD_DIALOG_CONSOLE),hParentWnd,ConsoleWndProc); break; } ConsoleWndInfoReset(hConsoleWnd); ShowWindow(hConsoleWnd,SW_HIDE); ConsoleWndInfoReset(hConsoleWnd); UpdateWindow(hConsoleWnd); ConsoleWndVerbosityApplyIncDec(0); CheckDlgButton(hConsoleWnd, IDC_CHECKBOX_VALID, ConsoleWndFlag); Edit_LimitText(GetDlgItem(hConsoleWnd,IDC_EDIT), ConsoleWndMaxSize); ConsoleWndInfoApply(); }
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam) { char szFormat [100]; char szTitle [MAX_TITLEBAR_LEN]; LPLOCATEPARAMS lplocate = (LPLOCATEPARAMS)lParam; if (!AllocDlgProp (hwnd, lplocate)) return FALSE; LoadString (hResource, (UINT)IDS_T_LOCATE, szFormat, sizeof (szFormat)); wsprintf (szTitle, szFormat, GetVirtNodeName (GetCurMdiNodeHandle ())); SetWindowText (hwnd, szTitle); lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_LOCATE)); // // Load the string "(all)" // if (LoadString (hResource, (UINT)IDS_I_LOCATE_ALL, String_all, sizeof (String_all)) == 0) x_strcpy (String_all, "(all)"); FillObjectTypes (hwnd); ComboBoxFillDatabases (GetDlgItem (hwnd, IDC_LOCATE_DATABASE)); if (ComboBox_GetCount (GetDlgItem (hwnd, IDC_LOCATE_OBJECTTYPE)) > 0) ComboBox_SetCurSel(GetDlgItem (hwnd, IDC_LOCATE_OBJECTTYPE), 0); Edit_LimitText (GetDlgItem (hwnd, IDC_LOCATE_FIND), MAXOBJECTNAME -1); Edit_SetText (GetDlgItem (hwnd, IDC_LOCATE_FIND), String_all); EnableDisableOKButton (hwnd); richCenterDialog(hwnd); return TRUE; }
BOOL CALLBACK CharNameDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND hName, hDesc; switch (message) { case WM_INITDIALOG: // Fiddle with "name" edit box hName = GetDlgItem(hDlg, IDC_NAME); SetWindowFont(hName, GetFont(FONT_INPUT), FALSE); Edit_LimitText(hName, MAX_CHARNAME); // Fiddle with "description" edit box hDesc = GetDlgItem(hDlg, IDC_DESCRIPTION); SetWindowFont(hDesc, GetFont(FONT_INPUT), FALSE); Edit_LimitText(hDesc, MAX_DESCRIPTION - 1); hTabPage = hDlg; SetFocus(hName); CenterWindow(hMakeCharDialog, GetParent(hMakeCharDialog)); break; HANDLE_MSG(hDlg, WM_COMMAND, CharTabPageCommand); case WM_NOTIFY: switch (((LPNMHDR) lParam)->code) { case PSN_SETACTIVE: SetFocus(GetDlgItem(hDlg, IDC_NAME)); break; case PSN_APPLY: VerifySettings(); // Don't quit dialog until we hear result from server SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); break; } return TRUE; } return FALSE; }
//Window Procedure LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { int id; static HWND hEdit; switch (msg) { case WM_CREATE: // Create Edit Control hEdit = CreateWindow(TEXT("EDIT"), NULL, WS_CHILD | WS_VISIBLE | ES_WANTRETURN | ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | WS_HSCROLL, 0, 0, 0, 0, hWnd, (HMENU)ID_EDIT, hInst, NULL); lstrcat(szTitle, TEXT("[無題]")); SetWindowText(hWnd, szTitle); Edit_LimitText(hEdit, 0); break; case WM_SIZE: // Adjust Window Size MoveWindow(hEdit, 0, 0, LOWORD(lp), HIWORD(lp), TRUE); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDM_NEW: MyNew(hEdit); break; case IDM_OPEN: MyOpen(hEdit); break; case IDM_END: SendMessage(hWnd, WM_CLOSE, 0, 0); break; case IDM_SAVE: MySave(hEdit); break; case IDM_SAVEAS: MySaveAs(hEdit); break; } break; case WM_SETFOCUS: SetFocus(hEdit); //set focus to edit control break; case WM_CLOSE: id = MyConfirm(hEdit); if (id == IDCANCEL) break; id = MessageBox(hWnd, TEXT("終了してもよろしいですか"), TEXT("確認"), MB_YESNO | MB_ICONQUESTION); if (id == IDYES) { DestroyWindow(hEdit); //destroy edit control DestroyWindow(hWnd); } break; case WM_DESTROY: PostQuitMessage(0); break; default: return (DefWindowProc(hWnd, msg, wp, lp)); } return 0; }
static void InitializeControls (HWND hwnd) { char *szMin = "0"; HWND hwndCkpNumber = GetDlgItem (hwnd, IDC_AUDITDB_CKP_NUMBER); SubclassAllNumericEditControls (hwnd, EC_SUBCLASS); Edit_LimitText (hwndCkpNumber, 10); Edit_SetText (hwndCkpNumber, szMin); LimitNumericEditControls (hwnd); }
/* * LookInitDialog: Handle WM_INITDIALOG messages. */ BOOL LookInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam) { DWORD style; int numItems, index; info = (LookDialogStruct *) lParam; CenterWindow(hDlg, GetParent(hDlg)); info->hwndListBox = GetDlgItem(hDlg, IDC_ITEMLIST); info->hwndFind = GetDlgItem(hDlg, IDC_ITEMFIND); info->hwndQuanList = GetDlgItem(hDlg, IDC_QUANLIST); // Make list sorted if desired if (info->flags & LD_SORT) { style = GetWindowLong(info->hwndListBox, GWL_STYLE); SetWindowLong(info->hwndListBox, GWL_STYLE, style | LBS_SORT); } if (!(info->flags & LD_AMOUNTS)) { ShowWindow(GetDlgItem(hDlg, IDC_STATIC1), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDC_QUANLIST), SW_HIDE); } // Draw objects in owner-drawn list box SetWindowLong(info->hwndListBox, GWL_USERDATA, OD_DRAWOBJ); SetWindowText(hDlg, info->title); /* Set window's title */ // Remember state of list box items info->selected = (Bool *) SafeMalloc(list_length(info->contents) * sizeof(Bool)); memset(info->selected, 0, list_length(info->contents) * sizeof(Bool)); LookListSetContents(info->hwndListBox, info->contents, info->flags); numItems = ListBox_GetCount(info->hwndListBox); for(index=0; index < numItems; index++) { ListBox_AddString(info->hwndQuanList," "); ListBox_SetItemData(info->hwndQuanList, index, 0); } Edit_LimitText(info->hwndFind, MAXNAME); SetWindowFont(info->hwndFind, GetFont(FONT_EDIT), TRUE); hwndLookDialog = hDlg; /* Subclass main list box */ info->lpfnDefLookProc = SubclassWindow(info->hwndListBox, LookProc); return TRUE; }
BOOL EditMark_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { HWND hwndCtrl; hwndCtrl = GetDlgItem( hwnd, IDC_MARK_NAME ); Edit_SetText( hwndCtrl, szMarkName ); Edit_LimitText( hwndCtrl, 30 ); hwndCtrl = GetDlgItem( hwnd, IDC_MARK_X ); Edit_SetText( hwndCtrl, szMarkX ); Edit_LimitText( hwndCtrl, 8 ); hwndCtrl = GetDlgItem( hwnd, IDC_MARK_Y ); Edit_SetText( hwndCtrl, szMarkY ); Edit_LimitText( hwndCtrl, 8 ); hwndCtrl = GetDlgItem( hwnd, IDC_MARK_Z ); Edit_SetText( hwndCtrl, szMarkZ ); Edit_LimitText( hwndCtrl, 8 ); hwndCtrl = GetDlgItem( hwnd, IDC_MARK_ROTATION ); Edit_SetText( hwndCtrl, szMarkRotation ); Edit_LimitText( hwndCtrl, 8 ); hwndCtrl = GetDlgItem( hwnd, IDC_MARK_ELEVATION ); Edit_SetText( hwndCtrl, szMarkElevation ); Edit_LimitText( hwndCtrl, 8 ); AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam ); return TRUE; } // EditMark_OnInitDialog
void ScriptEfitHandler::InitializeDialog(HWND dialog) { HWND ctl = 0; // Script TESComboBox::PopulateWithScripts(GetDlgItem(dialog,IDC_SEFF_SCRIPT),true,false,true); // Custom param res type ctl = GetDlgItem(dialog,IDC_SEFF_SCRIPTPARAMRESOLUTION); TESComboBox::Clear(ctl); TESComboBox::AddItem(ctl,"Unsigned Hex Integer",(void*)TESFileFormats::kResType_None); TESComboBox::AddItem(ctl,"FormID",(void*)TESFileFormats::kResType_FormID); TESComboBox::AddItem(ctl,"Magic Effect Code",(void*)TESFileFormats::kResType_MgefCode); TESComboBox::AddItem(ctl,"Actor Value",(void*)TESFileFormats::kResType_ActorValue); // custom param Edit_LimitText(GetDlgItem(dialog,IDC_SEFF_SCRIPTPARAM),8); // limit custom param to 8 characters }
BOOL CALLBACK AuthDialog::DlgProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { // This is a static method, so we don't know which instantiation we're // dealing with. But we can get a pseudo-this from the parameter to // WM_INITDIALOG, which we therafter store with the window and retrieve // as follows: AuthDialog *_this = helper::SafeGetWindowUserData<AuthDialog>(hwnd); switch (uMsg) { case WM_INITDIALOG: { helper::SafeSetWindowUserData(hwnd, lParam); _this = (AuthDialog *) lParam; Edit_LimitText(GetDlgItem(hwnd, IDC_PASSWD_EDIT), 32); //CentreWindow(hwnd); SetForegroundWindow(hwnd); return TRUE; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: { UINT res= GetDlgItemText( hwnd, IDC_PASSWD_EDIT, _this->m_passwd, 256); res= GetDlgItemText( hwnd, IDD_DOMAIN, _this->m_domain, 256); res= GetDlgItemText( hwnd, IDD_USER_NAME, _this->m_user, 256); EndDialog(hwnd, TRUE); return TRUE; } case IDCANCEL: EndDialog(hwnd, FALSE); return TRUE; } break; case WM_DESTROY: EndDialog(hwnd, FALSE); return TRUE; } return 0; }
BOOL CALLBACK ProfanityDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) { char term[MAXPROFANETERM+1]; switch (message) { case WM_INITDIALOG: CenterWindow(hDlg, GetParent(hDlg)); Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT1), MAXPROFANETERM); CheckRadioButton(hDlg, IDC_RADIO1, IDC_RADIO2, IDC_RADIO1+!config.ignoreprofane); CheckDlgButton(hDlg, IDC_CHECK1, config.extraprofane); SetFocus(GetDlgItem(hDlg, IDC_RADIO1+!config.ignoreprofane)); return FALSE; // return TRUE unless we set the focus case WM_COMMAND: switch(GET_WM_COMMAND_ID(wParam, lParam)) { case IDC_BUTTON1: GetDlgItemText(hDlg, IDC_EDIT1, term, sizeof(term)); AddProfaneTerm(term); SetDlgItemText(hDlg, IDC_EDIT1, ""); SetFocus(GetDlgItem(hDlg, IDC_EDIT1)); return TRUE; case IDC_BUTTON2: GetDlgItemText(hDlg, IDC_EDIT1, term, sizeof(term)); RemoveProfaneTerm(term); SetDlgItemText(hDlg, IDC_EDIT1, ""); SetFocus(GetDlgItem(hDlg, IDC_EDIT1)); return TRUE; case IDCANCEL: EndDialog(hDlg, IDCANCEL); return TRUE; case IDOK: config.ignoreprofane = IsDlgButtonChecked(hDlg, IDC_RADIO1); config.extraprofane = IsDlgButtonChecked(hDlg, IDC_CHECK1); RecompileAllProfaneExpressions(); EndDialog(hDlg, IDOK); return TRUE; } break; } return FALSE; }
static int OnInitDialog(HWND hDlg, LPARAM lParam) { PFILE_FULL_EA_INFORMATION * ppEaItem = (PFILE_FULL_EA_INFORMATION *)lParam; PFILE_FULL_EA_INFORMATION pEaItem = *ppEaItem; HWND hWndChild; // Configure the dialog SetWindowLongPtr(hDlg, DWLP_USER, lParam); SetDialogIcon(hDlg, IDI_FILE_TEST); CenterWindowToParent(hDlg); // Set the dialog title to "Insert" or to "Edit" SetWindowTextRc(hDlg, pEaItem ? IDS_EDIT_EA_TITLE : IDS_INSERT_EA_TITLE); // Set the name and value limit hWndChild = GetDlgItem(hDlg, IDC_DATA_NAME); if(hWndChild != NULL) Edit_LimitText(hWndChild, (BYTE)-1); // Fill the dialog nChangingEdit++; CheckDlgButton(hDlg, IDC_RADIO1, BST_CHECKED); if(pEaItem != NULL) { if(hWndChild != NULL) SetWindowTextA(hWndChild, pEaItem->EaName); SetDlgItemCText(hDlg, IDC_DATA_VALUE_TEXT, (LPBYTE)pEaItem->EaName + pEaItem->EaNameLength + 1, pEaItem->EaValueLength); SetDlgItemBin(hDlg, IDC_DATA_VALUE_BIN, (LPBYTE)pEaItem->EaName + pEaItem->EaNameLength + 1, pEaItem->EaValueLength); } UpdateDialog(hDlg); nChangingEdit--; return TRUE; }
/** * name: BeginLabelEdit * class: CPsTree * desc: begins the labeledit mode * param: hItem - handle of the treeitm whose label to edit * return: 0 **/ int CPsTree::BeginLabelEdit(HTREEITEM hItem) { CPsTreeItem* pti; // tree is readonly if (db_get_b(NULL, MODNAME, SET_PROPSHEET_READONLYLABEL, 0)) return 0; // get item text if (!hItem && !(hItem = TreeView_GetSelection(_hWndTree))) return 0; if (pti = FindItemByHandle(hItem)) { RECT rc, rcTree; // create the edit control GetClientRect(_hWndTree, &rcTree); TreeView_GetItemRect(_hWndTree, hItem, &rc, TRUE); _hLabelEdit = CreateWindowEx(WS_EX_NOPARENTNOTIFY|WS_EX_CLIENTEDGE, _T( "EDIT" ), pti->Label(), WS_VISIBLE|ES_AUTOHSCROLL|WS_CHILD, rc.left, rc.top, rcTree.right - rc.left, rc.bottom - rc.top, _hWndTree, NULL, ghInst, NULL ); if (_hLabelEdit) { _hDragItem = hItem; SetUserData(_hLabelEdit, this); mir_subclassWindow(_hLabelEdit, TPropsheetTree_LabelEditProc); SendMessage(_hLabelEdit, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0 ); Edit_SetSel(_hLabelEdit, 0, -1); Edit_LimitText(_hLabelEdit, MAX_TINAME); SetFocus(_hLabelEdit); return 0; } } return 1; }
DcxEdit::DcxEdit(const UINT ID, DcxDialog *p_Dialog, const HWND mParentHwnd, const RECT *rc, TString &styles) : DcxControl(ID, p_Dialog) { LONG Styles = 0, ExStyles = 0; BOOL bNoTheme = FALSE; this->parseControlStyles(styles, &Styles, &ExStyles, &bNoTheme); this->m_Hwnd = CreateWindowExW( ExStyles | WS_EX_CLIENTEDGE, L"EDIT", NULL, WS_CHILD | Styles, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, mParentHwnd, (HMENU) ID, GetModuleHandle(NULL), NULL); if (!IsWindow(this->m_Hwnd)) throw "Unable To Create Window"; if (bNoTheme) Dcx::UXModule.dcxSetWindowTheme(this->m_Hwnd , L" ", L" "); Edit_LimitText(this->m_Hwnd, 0); //this->m_tsText = ""; //SendMessage(this->m_Hwnd, CCM_SETUNICODEFORMAT, TRUE, NULL); if (p_Dialog->getToolTip() != NULL) { if (styles.istok("tooltips")) { this->m_ToolTipHWND = p_Dialog->getToolTip(); AddToolTipToolInfo(this->m_ToolTipHWND, this->m_Hwnd); } } this->m_bIgnoreRepeat = TRUE; this->setControlFont((HFONT) GetStockObject(DEFAULT_GUI_FONT), FALSE); this->registreDefaultWindowProc(); SetProp(this->m_Hwnd, "dcx_cthis", (HANDLE) this); DragAcceptFiles(this->m_Hwnd, TRUE); }