当前位置: 首页>>代码示例>>C++>>正文


C++ GetDlgItemTextW函数代码示例

本文整理汇总了C++中GetDlgItemTextW函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDlgItemTextW函数的具体用法?C++ GetDlgItemTextW怎么用?C++ GetDlgItemTextW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetDlgItemTextW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetDlgItemTextW

INT_PTR MainDlg::OnClose( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    ConfigMgr::ConfigData cfg;
    wchar_t imagePath[MAX_PATH];
    wchar_t initRoutine[MAX_PATH];
    wchar_t initArgs[MAX_PATH];
    wchar_t procCmdLine[MAX_PATH];

    cfg.newProcess = _newProcess;
    cfg.procName = _procPath;

    GetDlgItemTextW( _hMainDlg, IDC_IMAGE_PATH,  imagePath, ARRAYSIZE( imagePath ) );
    GetDlgItemTextW( _hMainDlg, IDC_CMDLINE,     procCmdLine, ARRAYSIZE( procCmdLine ) );
    GetDlgItemTextW( _hMainDlg, IDC_ARGUMENT,    initArgs, ARRAYSIZE( initArgs ) );
    GetDlgItemTextW( _hMainDlg, IDC_INIT_EXPORT, initRoutine, ARRAYSIZE( initRoutine ) );

    HWND hCombo = GetDlgItem( _hMainDlg, IDC_THREADS );
    DWORD thdId = (DWORD)ComboBox_GetItemData( hCombo, ComboBox_GetCurSel( hCombo ) );

    cfg.imagePath   = imagePath;
    cfg.procCmdLine = procCmdLine;
    cfg.initRoutine = initRoutine;
    cfg.initArgs    = initArgs;
    cfg.imagePath   = imagePath;

    cfg.manualMap = (ComboBox_GetCurSel( GetDlgItem( hDlg, IDC_OP_TYPE ) ) == 1);
    cfg.threadHijack = (thdId != 0 && thdId != 0xFFFFFFFF);
    cfg.manualMapFlags = MmapFlags();
    cfg.unlink = Button_GetCheck( GetDlgItem( _hMainDlg, IDC_UNLINK ) ) == 0 ? false : true;

    _config.Save( cfg );

    EndDialog( hDlg, 0 );
    return (INT_PTR)TRUE;
}
开发者ID:hezzrrah,项目名称:Xenos,代码行数:35,代码来源:Dlg_Funcs.cpp

示例2: AddressDialogProc

INT_PTR CALLBACK AddressDialogProc(
  HWND hwndDlg,  // handle to dialog box
  UINT uMsg,     // message
  WPARAM wParam, // first message parameter
  LPARAM lParam  // second message parameter
)
{
    ADDRESS_DATA *pAD;
    pAD = (ADDRESS_DATA *)GetWindowLongPtr(hwndDlg, DWLP_USER);
                
    switch (uMsg) 
    { 
    case WM_INITDIALOG:
        {
            // Store the ADDRESS_DATA pointer in the
            // window's user data
            SetWindowLongPtr(hwndDlg, DWLP_USER, lParam);
            pAD = (ADDRESS_DATA *)lParam;

            // Set the dialog title
            SetWindowText(hwndDlg, pAD->szTitle);
        }
        return TRUE;

    case WM_COMMAND: 
        switch (LOWORD(wParam)) 
        { 
        case IDOK: 
            {
                GetDlgItemTextW(
                    hwndDlg,
                    IDC_EDIT_ADDRESS_URI, 
                    pAD->szURI,
                    MAX_STRING
                    );

                GetDlgItemTextW(
                    hwndDlg,
                    IDC_EDIT_ADDRESS_NAME, 
                    pAD->szName,
                    MAX_STRING
                    );

                // Fall through
            }

        case IDCANCEL: 
            EndDialog(hwndDlg, wParam); 
            return TRUE; 
        } 
    } 

    return FALSE; 
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:54,代码来源:rtcdialogs.cpp

示例3: DIALOG_PAGESETUP_DlgProc

static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{

   switch (msg)
    {
    case WM_COMMAND:
      switch (wParam)
        {
        case IDOK:
          /* save user input and close dialog */
          GetDlgItemTextW(hDlg, IDC_PAGESETUP_HEADERVALUE, Globals.szHeader, ARRAY_SIZE(Globals.szHeader));
          GetDlgItemTextW(hDlg, IDC_PAGESETUP_FOOTERVALUE, Globals.szFooter, ARRAY_SIZE(Globals.szFooter));

          Globals.iMarginTop = GetDlgItemInt(hDlg, IDC_PAGESETUP_TOPVALUE, NULL, FALSE) * 100;
          Globals.iMarginBottom = GetDlgItemInt(hDlg, IDC_PAGESETUP_BOTTOMVALUE, NULL, FALSE) * 100;
          Globals.iMarginLeft = GetDlgItemInt(hDlg, IDC_PAGESETUP_LEFTVALUE, NULL, FALSE) * 100;
          Globals.iMarginRight = GetDlgItemInt(hDlg, IDC_PAGESETUP_RIGHTVALUE, NULL, FALSE) * 100;
          EndDialog(hDlg, IDOK);
          return TRUE;

        case IDCANCEL:
          /* discard user input and close dialog */
          EndDialog(hDlg, IDCANCEL);
          return TRUE;

        case IDHELP:
        {
          /* FIXME: Bring this to work */
          static const WCHAR sorryW[] = { 'S','o','r','r','y',',',' ','n','o',' ','h','e','l','p',' ','a','v','a','i','l','a','b','l','e',0 };
          static const WCHAR helpW[] = { 'H','e','l','p',0 };
          MessageBoxW(Globals.hMainWnd, sorryW, helpW, MB_ICONEXCLAMATION);
          return TRUE;
        }

	default:
	    break;
        }
      break;

    case WM_INITDIALOG:
       /* fetch last user input prior to display dialog */
       SetDlgItemTextW(hDlg, IDC_PAGESETUP_HEADERVALUE, Globals.szHeader);
       SetDlgItemTextW(hDlg, IDC_PAGESETUP_FOOTERVALUE, Globals.szFooter);
       SetDlgItemInt(hDlg, IDC_PAGESETUP_TOPVALUE, Globals.iMarginTop / 100, FALSE);
       SetDlgItemInt(hDlg, IDC_PAGESETUP_BOTTOMVALUE, Globals.iMarginBottom / 100, FALSE);
       SetDlgItemInt(hDlg, IDC_PAGESETUP_LEFTVALUE, Globals.iMarginLeft / 100, FALSE);
       SetDlgItemInt(hDlg, IDC_PAGESETUP_RIGHTVALUE, Globals.iMarginRight / 100, FALSE);
       break;
    }

  return FALSE;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:52,代码来源:dialog.c

示例4: GetDlgItemTextW

void CLogin::OnBnClickedOk()
{
	// TODO:  在此添加控件通知处理程序代码
	//CDialogEx::OnOK();
	CString name;
	CString password;
	GetDlgItemTextW(IDC_LOGINNANE, name);
	GetDlgItemTextW(IDC_LOGINPASSWORD, password);
	if (name == _T("wangyu")){
		_loginSuccess = true;
		CDialogEx::OnOK();
	}
}
开发者ID:ZTOMarcy,项目名称:GPS,代码行数:13,代码来源:in.cpp

示例5: Settings

INT_PTR CALLBACK Settings(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
	case WM_INITDIALOG:
		{
			SetDlgItemTextW(hDlg, IDC_EDIT_TEXT, config.text);
			SetDlgItemTextW(hDlg, IDC_EDIT_FONT_FAMILY, config.font);
			SetDlgItemInt(hDlg, IDC_EDIT_FONT_SIZE, config.height, FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_FILL_COLOR, config.fillColor.GetValue(), FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_OUTLINE_COLOR, config.outlineColor.GetValue(), FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_BACKGROUND_COLOR, config.backgroundColor.GetValue(), FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_X, config.position.X, FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_Y, config.position.Y, FALSE);
			SetDlgItemInt(hDlg, IDC_EDIT_ANGLE, config.angle, TRUE);
			wchar_t s[32];
			swprintf(s, -1, L"%.2f", config.scale);
			SetDlgItemTextW(hDlg, IDC_EDIT_SCALE, s);
			CheckDlgButton(hDlg, IDC_CHECK_QUALITY, config.antialiasing);
			CheckDlgButton(hDlg, IDC_CHECK_REGION, config.defaultRegion);
		}
		return (INT_PTR)TRUE;

	case WM_COMMAND:
		if (LOWORD(wParam) == IDOK)
		{
			wchar_t buff[32];
			GetDlgItemTextW(hDlg, IDC_EDIT_TEXT, buff, sizeof(buff));
			copy(config.text, buff);
			GetDlgItemTextW(hDlg, IDC_EDIT_FONT_FAMILY, buff, sizeof(buff));
			copy(config.font, buff);
			config.height = GetDlgItemInt(hDlg, IDC_EDIT_FONT_SIZE, 0, 0);
			config.fillColor = GetDlgItemInt(hDlg, IDC_EDIT_FILL_COLOR, 0, 0);
			config.outlineColor = GetDlgItemInt(hDlg, IDC_EDIT_OUTLINE_COLOR, 0, 0);
			config.backgroundColor = GetDlgItemInt(hDlg, IDC_EDIT_BACKGROUND_COLOR, 0, 0);
			config.position.X = GetDlgItemInt(hDlg, IDC_EDIT_X, 0, 0);
			config.position.Y = GetDlgItemInt(hDlg, IDC_EDIT_Y, 0, 0);
			config.angle = GetDlgItemInt(hDlg, IDC_EDIT_ANGLE, 0, 0);
			config.scale = GetDlgItemInt(hDlg, IDC_EDIT_SCALE, 0, 0);
			config.antialiasing = IsDlgButtonChecked(hDlg, IDC_CHECK_QUALITY);
			config.defaultRegion = IsDlgButtonChecked(hDlg, IDC_CHECK_REGION);
			EndDialog(hDlg, LOWORD(wParam));
			return (INT_PTR)TRUE;
		}

		break;
	}
	return (INT_PTR)FALSE;
}
开发者ID:slawiko,项目名称:CPP_practice,代码行数:50,代码来源:Gdi_1.cpp

示例6: GetDlgItemTextW

BOOL CFeedbackDialog::OnFeedbackClick()
{



 

  wstring wstrOtherReason;
  wstrOtherReason.resize(1024);
  int char_count = GetDlgItemTextW(IDC_REASON_EDIT, &wstrOtherReason[0], wstrOtherReason.length());

  if (char_count <= 0){
	  //进行响应提示
	  drawRectBorder(m_otherReasonEditCtrl.m_hWnd, RGB(255, 0, 0));
	  //
	  m_feedBackBtnCtrl.SetFocus();
	  m_otherReasonStaticCtrl.ShowWindow(SW_HIDE);
	  SetDlgItemText(IDC_OTHER_REASON_STATIC, L"你还没有输入反馈意见哦...");
	  have_feedback_num_ = false;
	  m_otherReasonStaticCtrl.ShowWindow(SW_SHOWNORMAL);
	  return TRUE;
  }

  have_feedback_num_ = true;
 std::string eid = YE_UNINSTALL_PREFIX "OtherReasonContent";
 std::string content;
 if (!YGW2A(wstrOtherReason, content, CP_UTF8))
		 content.clear();
 ygdata_report::SendCustomEvent(eid, GetEidDesc(eid), content);
  EndDialog(IDCLOSE);
  return TRUE;
}
开发者ID:510908220,项目名称:setup,代码行数:32,代码来源:feedback_dialog.cpp

示例7: ok_button_clicked

/* The okay button has been clicked or the enter enter key in the text
   field.  */
static void
ok_button_clicked (HWND dlg, pinentry_t pe)
{
    char *s_utf8;
    wchar_t *w_buffer;
    size_t w_buffer_size = 255;
    unsigned int nchar;

    pe->locale_err = 1;
    w_buffer = secmem_malloc ((w_buffer_size + 1) * sizeof *w_buffer);
    if (!w_buffer)
        return;

    nchar = GetDlgItemTextW (dlg, IDC_PINENT_TEXT, w_buffer, w_buffer_size);
    s_utf8 = wchar_to_utf8 (w_buffer, nchar, 1);
    secmem_free (w_buffer);
    if (s_utf8)
    {
        passphrase_ok = 1;
        pinentry_setbufferlen (pe, strlen (s_utf8) + 1);
        if (pe->pin)
            strcpy (pe->pin, s_utf8);
        secmem_free (s_utf8);
        pe->locale_err = 0;
        pe->result = pe->pin? strlen (pe->pin) : 0;
    }
}
开发者ID:hakamadare,项目名称:pinentry-mac,代码行数:29,代码来源:main.c

示例8: PassphraseDialogFunc

BOOL CALLBACK PassphraseDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, UNUSED LPARAM lParam)
{
  static char empty_string[100];

  switch (msg) {

    case WM_INITDIALOG:
      SetForegroundWindow(hwndDlg);
      break;

    case WM_COMMAND:
      switch (LOWORD(wParam)) {

        case IDOK:			// button
          GetDlgItemTextW(hwndDlg, EDIT_PASSPHRASE, passphrase, sizeof(passphrase)/2 - 1);

          /* Clear buffer */
          SetDlgItemText(hwndDlg, EDIT_PASSPHRASE, empty_string);

          EndDialog(hwndDlg, LOWORD(wParam));
          return TRUE;

        case IDCANCEL:			// button
          EndDialog(hwndDlg, LOWORD(wParam));
          return TRUE;
      }
      break;
    case WM_CLOSE:
      EndDialog(hwndDlg, LOWORD(wParam));
      return TRUE;
     
  }
  return FALSE;
}
开发者ID:Danixu,项目名称:OpenVPN-Portable,代码行数:34,代码来源:passphrase.c

示例9: ShowWindow

void plExportDlgImp::IDoExport()
{
    fExporting = true;

    // Hide the window, since we don't get control back until the export is done
    ShowWindow(fDlg, SW_HIDE);

    // Do the export
    wchar_t exportPathTEMP[MAX_PATH];
    GetDlgItemTextW(fDlg, IDC_CLIENT_PATH, exportPathTEMP, arrsize(exportPathTEMP));
    plFileName exportPath = plFileName::Join(plString::FromWchar(exportPathTEMP), "Export.prd");

    // For export time stats
    DWORD exportTime = timeGetTime();

    if (fExportFile)
        IExportCurrentFile(exportPath.AsString().c_str());
    else
    {
        std::vector<plFileName> sources = plFileSystem::ListDir(fExportSourceDir, "*.max");
        for (auto iter = sources.begin(); iter != sources.end(); ++iter)
        {
            if (GetCOREInterface()->LoadFromFile(iter->AsString().c_str()))
                IExportCurrentFile(exportPath.AsString().c_str());
        }
    }

    fLastExportTime = (timeGetTime() - exportTime) / 1000;

    IDestroy();

    fExporting = false;
}
开发者ID:MareinK,项目名称:Plasma,代码行数:33,代码来源:plExportDlg.cpp

示例10: dlogpassproc

INT_PTR CALLBACK
dlogpassproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_INITDIALOG:
		SetDlgItemTextA(hwnd, 4, pd_filename);
		return TRUE;
	case WM_COMMAND:
		switch(wParam)
		{
		case 1:
			pd_okay = 1;
			GetDlgItemTextW(hwnd, 3, pd_passwordw, nelem(pd_passwordw));
			EndDialog(hwnd, 1);
			WideCharToMultiByte(CP_UTF8, 0, pd_passwordw, -1, pd_password, sizeof pd_password, NULL, NULL);
			return TRUE;
		case 2:
			pd_okay = 0;
			EndDialog(hwnd, 1);
			return TRUE;
		}
		break;
	}
	return FALSE;
}
开发者ID:n1tehawk,项目名称:mupdf,代码行数:26,代码来源:win_main.c

示例11: FD31_Validate

/***********************************************************************
 *                              FD31_Validate               [internal]
 *   called on: click Ok button, Enter in edit, DoubleClick in file list
 */
static LRESULT FD31_Validate( PFD31_DATA lfs, LPWSTR path, UINT control, INT itemIndex,
                                 BOOL internalUse )
{
    LONG lRet;
    HWND hWnd = lfs->hwnd;
    OPENFILENAMEW ofnsav;
    LPOPENFILENAMEW ofnW = lfs->ofnW;
    WCHAR filename[BUFFILE];

    ofnsav = *ofnW; /* for later restoring */

    /* get current file name */
    if (path)
        lstrcpynW(filename, path, sizeof(filename)/sizeof(WCHAR));
    else
        GetDlgItemTextW( hWnd, edt1, filename, sizeof(filename)/sizeof(WCHAR));

    TRACE("got filename = %s\n", debugstr_w(filename));
    /* if we did not click in file list to get there */
    if (control != lst1)
    {
        if (!FD31_TestPath( lfs, filename) )
           return FALSE;
    }
    FD31_UpdateResult(lfs, filename);

    if (internalUse)
    { /* called internally after a change in a combo */
        if (lfs->hook)
        {
             FD31_CallWindowProc(lfs, lfs->lbselchstring, control,
                             MAKELONG(itemIndex,CD_LBSELCHANGE));
        }
        return TRUE;
    }

    FD31_UpdateFileTitle(lfs);
    if (lfs->hook)
    {
        lRet = (BOOL)FD31_CallWindowProc(lfs, lfs->fileokstring,
                  0, lfs->lParam );
        if (lRet)
        {
            *ofnW = ofnsav; /* restore old state */
            return FALSE;
        }
    }
    if ((ofnW->Flags & OFN_ALLOWMULTISELECT) && (ofnW->Flags & OFN_EXPLORER))
    {
        if (ofnW->lpstrFile)
        {
            LPWSTR str = (LPWSTR)ofnW->lpstrFile;
            LPWSTR ptr = strrchrW(str, '\\');
	    str[lstrlenW(str) + 1] = '\0';
	    *ptr = 0;
        }
    }
    return TRUE;
}
开发者ID:howard5888,项目名称:wineT,代码行数:63,代码来源:filedlg31.c

示例12: wbuf

UINT TWin::GetDlgItemTextU8(int ctlId, char *buf, int len)
{
	Wstr	wbuf(len);

	*buf = 0;
	GetDlgItemTextW(ctlId, wbuf.Buf(), len);

	return	WtoU8(wbuf.s(), buf, len);
}
开发者ID:glukki,项目名称:ipmsg,代码行数:9,代码来源:twin.cpp

示例13: AuthPasswordDialogFunc

BOOL CALLBACK AuthPasswordDialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
  static struct user_auth *user_auth;
  static char empty_string[100];
  WCHAR username_unicode[50];
  WCHAR password_unicode[50];

  switch (msg) {

    case WM_INITDIALOG:
      user_auth = (struct user_auth *) lParam;
      SetForegroundWindow(hwndDlg);
      break;

    case WM_COMMAND:
      switch (LOWORD(wParam)) {

        case IDOK:			// button
          GetDlgItemTextW(hwndDlg, EDIT_AUTH_USERNAME, username_unicode, sizeof(username_unicode)/2 - 1);
          GetDlgItemTextW(hwndDlg, EDIT_AUTH_PASSWORD, password_unicode, sizeof(password_unicode)/2 - 1);

          /* Convert username/password from Unicode to Ascii (CP850) */
          ConvertUnicode2Ascii(username_unicode, user_auth->username, sizeof(user_auth->username) - 1);
          ConvertUnicode2Ascii(password_unicode, user_auth->password, sizeof(user_auth->password) - 1);

          /* Clear buffers */
          SetDlgItemText(hwndDlg, EDIT_AUTH_USERNAME, empty_string);
          SetDlgItemText(hwndDlg, EDIT_AUTH_PASSWORD, empty_string);

          EndDialog(hwndDlg, LOWORD(wParam));
          return TRUE;

        case IDCANCEL:			// button
          EndDialog(hwndDlg, LOWORD(wParam));
          return TRUE;
      }
      break;
    case WM_CLOSE:
      EndDialog(hwndDlg, LOWORD(wParam));
      return TRUE;
     
  }
  return FALSE;
}
开发者ID:Danixu,项目名称:OpenVPN-Portable,代码行数:44,代码来源:passphrase.c

示例14: editdata_str_to_bytes

static void editdata_str_to_bytes(EDITDATA *ed, HWND hWnd, int item)	{

	GetDlgItemTextW(hWnd, item, ed->str, MAX_EDIT_STR);
	if(ed->codepage)	{
		// excluding the terminating null character
		ed->bytes_len = WideCharToMultiByte(ed->codepage, 0, ed->str, -1, (LPSTR)ed->bytes, MAX_EDIT_STR * 3, NULL, NULL) - 1;
	} else {
		ed->bytes_len = milstr_solveHEXbuffer(ed->bytes, MAX_EDIT_STR, ed->str);
	}
}
开发者ID:LasDesu,项目名称:np2debug,代码行数:10,代码来源:d_edit.cpp

示例15: GetDlgItemTextW

BOOL TInstDlg::AppKick()
{
	WCHAR	setupDir[MAX_PATH], setupPath[MAX_PATH];

	GetDlgItemTextW(FILE_EDIT, setupDir, wsizeof(setupDir));
	SetCurrentDirectoryW(setupDir);

	MakePathW(setupPath, setupDir, IPMSG_EXENAME_W);
	return	(int)ShellExecuteW(NULL, NULL, setupPath, L"/SHOW_HISTORY", 0, SW_SHOW) > 32;
}
开发者ID:glukki,项目名称:ipmsg,代码行数:10,代码来源:install.cpp


注:本文中的GetDlgItemTextW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。