• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetDlgItemTextA函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DlgProc2

//反汇编对话框的消息处理
BOOL CALLBACK DlgProc2(HWND hdlg,UINT message,WPARAM  wParam,	LPARAM  lParam)
{
	switch(message)
	{
	case WM_INITDIALOG:
		break;
	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case ID_OK:
			{
				char szStr[20];
				GetDlgItemTextA(hdlg, IDC_EDIT1, szStr, 20);
				StartAddress = atoi(szStr);
				GetDlgItemTextA(hdlg, IDC_EDIT2, szStr, 20);
				Size = atoi(szStr);
				EndDialog(hdlg, 0);
			}
			break;
		case ID_CLOSE:
			EndDialog(hdlg, 0);
			break;
		}

	}
	return 0;
}
开发者ID:Izib,项目名称:dbg,代码行数:28,代码来源:Test.cpp


示例2: MainDlgProc

int WINAPI MainDlgProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
	CHAR ExeFilePath[MAX_PATH] = {0};
	CHAR SysFilePath[MAX_PATH] = {0};

	if (message == WM_COMMAND)
	{
		if (wParam == IDOK)
		{
			if (GetDlgItemTextA(hWnd, IDC_PATH_EXE, ExeFilePath, MAX_PATH-1))
			{
				if (GetDlgItemTextA(hWnd, IDC_PATH_SYS, SysFilePath, MAX_PATH-1))
				{
					if (BuildDropper(ExeFilePath, SysFilePath))
					{
						MessageBoxA(hWnd, "OK", "OK", MB_OK);
					}
				}
			}

			return 0;
		}

		if (wParam == IDC_CHOSE_EXE)
		{
			char *file = OpenFileDialog("Executable files (*.exe)\0*.exe\0", hWnd);
			if (file)
			{
				SetDlgItemText(hWnd, IDC_PATH_EXE, file);
			
				delete file;
			}

			return 0;
		}

		if (wParam == IDC_CHOSE_SYS)
		{
			char *file = OpenFileDialog("Executable files (*.sys)\0*.sys\0", hWnd);
			if (file)
			{
				SetDlgItemText(hWnd, IDC_PATH_SYS, file);

				delete file;
			}

			return 0;
		}

		if (wParam == IDCANCEL)
		{
			return EndDialog(hWnd, 0), ExitProcess(0), 0;
		}
	}

	return 0;
}
开发者ID:AlexWMF,项目名称:Carberp,代码行数:57,代码来源:builder.cpp


示例3: DlgProcContactInfo

INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
{
	switch (msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwnd);
		{
			MCONTACT hContact = (MCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
			char name[2048];
			SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hContact);

			if (db_get_static(hContact, MODNAME, "Name", name, _countof(name)))
				break;
			SetDlgItemTextA(hwnd, IDC_DISPLAY_NAME, name);
			if (db_get_static(hContact, MODNAME, "ToolTip", name, _countof(name)))
				break;
			SetDlgItemTextA(hwnd, IDC_TOOLTIP, name);
		}
		return TRUE;

	case WM_COMMAND:
		SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
		return TRUE;

	case WM_NOTIFY:
		switch (((LPNMHDR)lParam)->idFrom) {
		case 0:
			switch (((LPNMHDR)lParam)->code) {
			case PSN_APPLY:
				MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
				if (GetWindowTextLength(GetDlgItem(hwnd, IDC_DISPLAY_NAME))) {
					char text[512];
					GetDlgItemTextA(hwnd, IDC_DISPLAY_NAME, text, _countof(text));
					db_set_s(hContact, MODNAME, "Name", text);
					WriteSetting(hContact, MODNAME, "Name", MODNAME, "Nick");
				}
				else {
					db_unset(hContact, MODNAME, "Name");
					db_unset(hContact, MODNAME, "Nick");
				}

				if (GetWindowTextLength(GetDlgItem(hwnd, IDC_TOOLTIP))) {
					char text[2048];
					GetDlgItemTextA(hwnd, IDC_TOOLTIP, text, _countof(text));
					db_set_s(hContact, MODNAME, "ToolTip", text);
					WriteSetting(hContact, MODNAME, "ToolTip", "UserInfo", "MyNotes");
				}
				else {
					db_unset(hContact, MODNAME, "ToolTip");
					db_unset(hContact, "UserInfo", "MyNotes");
				}
			}
			return TRUE;
		}
		break;
	}
	return FALSE;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:57,代码来源:contactinfo.cpp


示例4: PromptForInputDialogProc

	static INT_PTR CALLBACK PromptForInputDialogProc(HWND dialogHandle, UINT message, WPARAM wParam, LPARAM lParam)
	{
		BOOL result = TRUE;

		// Initialization
		if (message == WM_INITDIALOG)
		{
			// Text initialization
			TInputDialogInitInfo *pInfo = reinterpret_cast<TInputDialogInitInfo *>(lParam);

			SetWindowTextA(dialogHandle, pInfo->get<1>().c_str());
			SetDlgItemTextA(dialogHandle, IDC_PROMPT, pInfo->get<2>().c_str());
			SetDlgItemTextA(dialogHandle, IDC_EDIT_CONTENT, pInfo->get<3>().c_str());
			SetDlgItemTextA(dialogHandle, IDOK, pInfo->get<4>().c_str());
			SetDlgItemTextA(dialogHandle, IDCANCEL, pInfo->get<5>().c_str());
		}
		// Clicked button
		else if (message == WM_COMMAND)
		{
			// ID that triggered
			UINT id = LOWORD(wParam);
			// Clicked "OK" or "Cancel"
			if (id == IDOK || id == IDCANCEL)
			{
				// TODO: Duplicate code.
				SInputInfo *pInfo = reinterpret_cast<SInputInfo *>(malloc(sizeof(SInputInfo)));
				if (pInfo)
				{
					pInfo->isOkClicked = (id == IDOK);
					GetDlgItemTextA(dialogHandle, IDC_EDIT_CONTENT, pInfo->text, sizeof(pInfo->text));
				}

				EndDialog(dialogHandle, reinterpret_cast<INT_PTR>(pInfo));
			}
		}
		// Clicked close
		else if (message == WM_CLOSE)
		{
			// TODO: Duplicate code.
			SInputInfo *pInfo = reinterpret_cast<SInputInfo *>(malloc(sizeof(SInputInfo)));
			if (pInfo)
			{
				pInfo->isOkClicked = false;
				GetDlgItemTextA(dialogHandle, IDC_EDIT_CONTENT, pInfo->text, sizeof(pInfo->text));
			}

			EndDialog(dialogHandle, reinterpret_cast<INT_PTR>(pInfo));
		}
		// Messages that not interested
		else
		{
			result = FALSE;
		}

		return result;
	}
开发者ID:myeang1,项目名称:YDWE,代码行数:56,代码来源:luaopen_gui.cpp


示例5: GetSetting

VOID GetSetting(HWND hwnd)
{
    int i;
    CHAR buf[256];
    for (i = 0; i < hack_argcount; i++)
    {
        GetDlgItemTextA(hwnd, IDC_ARGVAL00 + i, buf, 256);
        sz_trim(buf);
        switch (hack_arginfo[i].type)
        {
        case t_Bool:
            if (lstrcmpiA(buf, "True") == 0 || lstrcmpiA(buf, "1") == 0 )
                *(Bool *)hack_arginfo[i].data = True;
            else if (lstrcmpiA(buf, "False") == 0 || lstrcmpiA(buf, "0") == 0 )
                *(Bool *)hack_arginfo[i].data = False;
            break;

        case t_Int:
            *(INT *)hack_arginfo[i].data = strtol(buf, NULL, 10);
            break;

        case t_Float:
            *(float *)hack_arginfo[i].data = strtod(buf, NULL);
            break;

        case t_String:
            *(char **)hack_arginfo[i].data = _strdup(buf);
            break;
        }
    }
    if (hack_count_enabled)
    {
        GetDlgItemTextA(hwnd, IDC_COUNTVAL, buf, 256);
        sz_trim(buf);
        ss.modeinfo.count = strtol(buf, NULL, 10);
    }
    if (hack_cycles_enabled)
    {
        GetDlgItemTextA(hwnd, IDC_CYCLESVAL, buf, 256);
        sz_trim(buf);
        ss.modeinfo.cycles = strtol(buf, NULL, 10);
    }
    if (hack_size_enabled)
    {
        GetDlgItemTextA(hwnd, IDC_SIZEVAL, buf, 256);
        sz_trim(buf);
        ss.modeinfo.size = strtol(buf, NULL, 10);
    }
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:49,代码来源:xlockmore.c


示例6: WaitForSingleObject

void upsStatus::Update(StatMgr *statmgr)
{
   // Bail if window is not open
   WaitForSingleObject(_mutex, INFINITE);
   if (!_hwnd)
   {
      ReleaseMutex(_mutex);
      return;
   }

   // Fetch full status from nutupsd
   list<string> keys, values;
   if (!statmgr->GetAll(keys, values) || keys.empty())
   {
	  ReleaseMutex(_mutex);
      return;
   }

   // Update listview
   list<string>* data[] = {&keys, &values};
   _grid->UpdateAll(data);

   // Update battery
   _bmeter->Set(atoi(statmgr->Get("battery.charge").c_str()));

   // Update load
   _lmeter->Set(atoi(statmgr->Get("ups.load").c_str()));

   // Update status
   char str[128];
   string stat = statmgr->Get("ups.status");
   GetDlgItemTextA(_hwnd, IDC_STATUS, str, sizeof(str));
   if (stat != str)
	   SetDlgItemTextA(_hwnd, IDC_STATUS, stat.c_str());

   // Update runtime
   string runtime = statmgr->Get("battery.runtime");
   GetDlgItemTextA(_hwnd, IDC_RUNTIME, str, sizeof(str));
   if (runtime != str)
      SetDlgItemTextA(_hwnd, IDC_RUNTIME, runtime.c_str());

   // Update title bar
   char name[512];
   string upsname = statmgr->Get("UPS");
   snprintf(name, sizeof(name), "Status for UPS: %s", upsname.c_str());
   SetWindowTextA(_hwnd, name);
   
   ReleaseMutex(_mutex);
}
开发者ID:FrColin,项目名称:NutTray,代码行数:49,代码来源:winstat.cpp


示例7: GetDlgItemTextA

void ProjectConfigDialog::onSelectScriptFile(void)
{
    char buff[MAX_PATH + 1] = {0};
    char projdir[MAX_PATH + 1] = {0};
    GetDlgItemTextA(m_hwndDialog, IDC_EDIT_PROJECT_DIR, projdir, MAX_PATH);

    OPENFILENAMEA ofn = {0};
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = m_hwndDialog;
    ofn.lpstrFilter = "Lua Script File (*.lua)\0*.lua\0";
    ofn.lpstrTitle = "Select Script File";
    if (DirectoryExists(projdir))
    {
        ofn.lpstrInitialDir = projdir;
    }
    ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
    ofn.lpstrFile = buff;
    ofn.nMaxFile = MAX_PATH;

    if (GetOpenFileNameA(&ofn))
    {
        m_project.setScriptFile(buff);
        updateScriptFile();
    }
}
开发者ID:AlexYanJianhua,项目名称:quick-cocos2d-x,代码行数:25,代码来源:ProjectConfigDialog.cpp


示例8: AboutProc

LRESULT CALLBACK AboutProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM)
{
	char buf[48];
	DWORD d;

	switch(message){
		case WM_INITDIALOG:
			setDlgTexts(hWnd, 11);
			d=getVer();
			sprintf(buf, "%d.%d", HIWORD(d), LOWORD(d));
			SetDlgItemTextA(hWnd, 101, buf);
			return TRUE;

		case WM_COMMAND:
			switch(wParam){
				case IDOK:
				case IDCANCEL:
					EndDialog(hWnd, wParam);
					return TRUE;
				case 123:
					GetDlgItemTextA(hWnd, wParam, buf, sizeA(buf)-13);
					if(!_tcscmp(lang, _T("English"))) strcat(buf, "/indexEN.html");
					ShellExecuteA(0, 0, buf, 0, 0, SW_SHOWNORMAL);
					break;
			}
			break;
	}
	return FALSE;
}
开发者ID:kambala-decapitator,项目名称:colorsudoku,代码行数:29,代码来源:sudoku.cpp


示例9: dlogpassproc

INT 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;
			GetDlgItemTextA(hwnd, 3, pd_password, sizeof pd_password);
			EndDialog(hwnd, 1);
			return TRUE;
		case 2:
			pd_okay = 0;
			EndDialog(hwnd, 1);
			return TRUE;
		}
		break;
	}
	return FALSE;
}
开发者ID:AvinashKiran,项目名称:mupdf,代码行数:25,代码来源:win_main.c


示例10: JabbeSearchrRenewFields

static int JabbeSearchrRenewFields(HWND hwndDlg, JabberSearchData * dat)
{
	char szServerName[100];
	EnableWindow(GetDlgItem(hwndDlg, IDC_GO),FALSE);
	GetDlgItemTextA(hwndDlg,IDC_SERVER,szServerName,sizeof(szServerName));
	dat->CurrentHeight = 0;
	dat->curPos = 0;
	SetScrollPos( GetDlgItem( hwndDlg, IDC_VSCROLL ), SB_CTL, 0, FALSE );

	JabberSearchFreeData( hwndDlg, dat );
	JabberSearchRefreshFrameScroll( hwndDlg, dat );
	

	if ( jabberOnline )
		SetDlgItemText(hwndDlg,IDC_INSTRUCTIONS,TranslateT("Please wait...\r\nConnecting search server..."));
	else
		SetDlgItemText(hwndDlg,IDC_INSTRUCTIONS,TranslateT("You have to be connected to server"));

	if ( !jabberOnline )
		return 0;

	searchHandleDlg = hwndDlg;

	int iqId = JabberSerialNext();
	XmlNodeIq iq( "get", iqId, szServerName );
	XmlNode* query = iq.addChild( "query" );
	query->addAttr( "xmlns", "jabber:iq:search" );
	JabberIqAdd( iqId, IQ_PROC_GETSEARCHFIELDS, JabberIqResultGetSearchFields );
	JabberSend( jabberThreadInfo->s, iq );
	return iqId;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:31,代码来源:jabber_search.cpp


示例11: Window_StopwatchExportDlg

static INT_PTR CALLBACK Window_StopwatchExportDlg(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	(void)lParam; // unused
	switch(msg) {
	case WM_INITDIALOG:{
		wchar_t buf[128];
		api.GetStr(L"Timers", L"SwExT", buf, _countof(buf), L"");
		SetDlgItemText(hDlg,IDC_SWE_TOTAL,buf);
		api.GetStr(L"Timers", L"SwExL", buf, _countof(buf), L"");
		SetDlgItemText(hDlg, IDC_SWE_LAP, buf);
		SendMessage(hDlg, WM_COMMAND,IDOK, 0);
		Edit_SetSel(GetDlgItem(hDlg,IDC_SWE_OUT), 0, -1);
		SetFocus(GetDlgItem(hDlg,IDC_SWE_OUT));
		return FALSE;}
	case WM_DESTROY:{
		break;}
	case WM_COMMAND: {
			switch(LOWORD(wParam)) {
			case IDC_SWE_EXPORT:{
				wchar_t filename[MAX_PATH];
				unsigned buflen = (unsigned)SendDlgItemMessageA(hDlg,IDC_SWE_OUT,WM_GETTEXTLENGTH,0,0);
				char* buf = malloc(buflen + 1);
				if(buf && buflen){
					GetDlgItemTextA(hDlg, IDC_SWE_OUT, buf, buflen+1);
					*filename = '\0';
					if(SaveFileDialog(hDlg,filename,_countof(filename))){
						FILE* fp = _wfopen(filename, L"wb");
						if(fp){
							fwrite(buf, sizeof(buf[0]), buflen, fp);
							fclose(fp);
						}
					}
				}
				free(buf);
				break;}
			case IDOK:{
				wchar_t buf[128];
				GetDlgItemText(hDlg, IDC_SWE_TOTAL, buf, _countof(buf));
				if(!*buf){
					api.DelValue(L"Timers", L"SwExT");
					SetDlgItemText(hDlg, IDC_SWE_TOTAL, L"\\n--------------------\\n\\t");
				}else
					api.SetStr(L"Timers", L"SwExT", buf);
				GetDlgItemText(hDlg, IDC_SWE_LAP, buf, _countof(buf));
				if(!*buf){
					api.DelValue(L"Timers", L"SwExL");
					SetDlgItemText(hDlg, IDC_SWE_LAP, L"Lap \\#\\f: \\l (\\t)\\n");
				}else
					api.SetStr(L"Timers", L"SwExL", buf);
				export_text(hDlg);
				break;}
			case IDCANCEL:
				EndDialog(hDlg, TRUE);
			}
			return TRUE;
		}
	}
	return FALSE;
}
开发者ID:heicks,项目名称:T-Clock,代码行数:59,代码来源:StopWatch.c


示例12: searchPackTLVWordLNTS

static void searchPackTLVWordLNTS(PBYTE *buf, int *buflen, HWND hwndDlg, UINT idControl, WORD w, WORD wType)
{
	char str[512];

	GetDlgItemTextA(hwndDlg, idControl, str, sizeof(str));

	ppackLETLVWordLNTS(buf, buflen, w, str, wType, 0);
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:8,代码来源:icq_advsearch.cpp


示例13: PwConfirmDlgProc

static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	PwConfirmDlgParam* dat = (PwConfirmDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);

	switch(msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwndDlg);
		SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
		SendDlgItemMessage(hwndDlg,IDC_PASSWORD,EM_LIMITTEXT,15,0);
		return TRUE;

	case WM_COMMAND:
		switch(LOWORD(wParam)) {
		case IDOK:
			{  
				char szTest[16];

				GetDlgItemTextA(hwndDlg,IDC_OLDPASS,szTest,sizeof(szTest));

				if (strcmpnull(szTest, dat->ppro->GetUserPassword(TRUE))) 
				{
					MessageBox(hwndDlg, TranslateT("The password does not match your current password. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK);
					SendDlgItemMessage(hwndDlg,IDC_OLDPASS,EM_SETSEL,0,(LPARAM)-1);
					SetFocus(GetDlgItem(hwndDlg,IDC_OLDPASS));
					break;
				}

				GetDlgItemTextA(hwndDlg,IDC_PASSWORD,szTest,sizeof(szTest));
				if(strcmpnull(szTest, dat->Pass)) 
				{
					MessageBox(hwndDlg, TranslateT("The password does not match the password you originally entered. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK);
					SendDlgItemMessage(hwndDlg,IDC_PASSWORD,EM_SETSEL,0,(LPARAM)-1);
					SetFocus(GetDlgItem(hwndDlg,IDC_PASSWORD));
					break;
				}
			}
		case IDCANCEL:
			EndDialog(hwndDlg,wParam);
			break;
		}
		break;
	}
	return FALSE;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:44,代码来源:db.cpp


示例14: PreTranslateMessage

// 먼저 한번 거르고 메시지 처리
void PreTranslateMessage(LPMSG msg){
	if (msg->message == WM_KEYUP)
	{
		switch (msg->wParam)
		{
		case VK_RETURN:
			if (GetFocus() == _hwMemo){
				GetDlgItemTextA(_hw, EDIT1, buffer2, sizeof(buffer2));
				if (strlen(buffer2) != 0){
					//ID
					string a = buffer2;
					GetDlgItemTextA(_hw, EDIT4, buffer2, sizeof(buffer2));
					string b = buffer2;
					a = b + ": " + a;

					MyMessObj.SendMessagePort(a);
					g_pChatMgr->setInputString(">");
					SetWindowText(GetDlgItem(_hw, EDIT1), L"");					
				}
				else {
					g_pChatMgr->setInputString("");
					//SetFocus(_hw);
				}				
				break;
				//return;/*i don't want this message to reach the procedures anway*/
			}
		case VK_ESCAPE:
			g_pChatMgr->setInputString("");
			SetFocus(_hw);
			break;
		default:
			if (GetFocus() == _hwMemo){				
				GetDlgItemTextA(_hw, EDIT1, buffer3, sizeof(buffer3));				
				string input = buffer3;
				input = ">" + input;
				g_pChatMgr->setInputString(input);
			}
			break;
		}		
	}
	TranslateMessage(msg);
	DispatchMessage(msg);
}
开发者ID:arkiny,项目名称:DreamCoast2D,代码行数:44,代码来源:cGameApplication.cpp


示例15: UT_return_val_if_fail

UT_UTF8String AP_Win32Dialog_GenericInput::_getText(HWND hWnd, int nID)
{
    UT_return_val_if_fail(hWnd, UT_UTF8String());

    const int buflen = 4096;
    char szBuff[buflen];
    *szBuff=0;
    GetDlgItemTextA(hWnd, nID, szBuff, buflen);
    szBuff[buflen-1] = '\0';
    return AP_Win32App::s_fromWinLocaleToUTF8(szBuff);
}
开发者ID:tanya-guza,项目名称:abiword,代码行数:11,代码来源:ap_Win32Dialog_GenericInput.cpp


示例16: GetDlgItemInt

void PERF::OnBnClickedOk()
{
	CTT3App *tA    = (CTT3App*)theApp.GetMainWnd();
	CTT3Dlg *pW    = (CTT3Dlg*)tA;
	pW->iPerfPub   = GetDlgItemInt(IDC_EDIT1, 0, FALSE);
	pW->iDelay     = GetDlgItemInt(IDC_EDIT2, 0, FALSE);
	pW->iTT3Apps   = GetDlgItemInt(IDC_EDIT4, 0, FALSE);
	GetDlgItemTextA(IDC_EDIT5, pW->sTT3Subscribe, 100);

	CDialog::OnOK();
}
开发者ID:12019,项目名称:TT3,代码行数:11,代码来源:PERF.cpp


示例17: JabberSearchByAdvanced

int JabberSearchByAdvanced( WPARAM wParam, LPARAM lParam )
{
	if ( !jabberOnline || !lParam)
		return 0;	//error

	HWND hwndDlg=(HWND) lParam;
	JabberSearchData * dat=(JabberSearchData *)GetWindowLong(hwndDlg,GWL_USERDATA);
	if ( !dat )
		return 0; //error

	// check if server connected (at least one field exists)
	if ( dat->nJSInfCount == 0 )
		return 0;

	// formating request
	BOOL fRequestNotEmpty=FALSE;

	// get server name
	char szServerName[100];
	GetDlgItemTextA( hwndDlg, IDC_SERVER, szServerName, sizeof( szServerName ));

	// formating query
	int iqId = JabberSerialNext();
	XmlNodeIq iq( "set", iqId, szServerName );
	XmlNode* query = iq.addChild( "query" ), *field;
	iq.addAttr( "xml:lang", "en" ); //? not sure is it needed ?
	query->addAttr( "xmlns", "jabber:iq:search" );

	// next can be 2 cases:
	// Forms: XEP-0055 Example 7
	if ( dat->fSearchRequestIsXForm ) {
		fRequestNotEmpty=TRUE;
		query->addChild(JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), dat->xNode));
    }
	else { //and Simple fields: XEP-0055 Example 3
		for ( int i=0; i<dat->nJSInfCount; i++ ) {
			TCHAR szFieldValue[100];
			GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, SIZEOF(szFieldValue));
			if ( szFieldValue[0] != _T('\0')) {
				char* szTemp=t2a(dat->pJSInf[i].szFieldName);
				field = query->addChild( szTemp, szFieldValue );
				mir_free(szTemp);
				fRequestNotEmpty=TRUE;
	}	}	}

	if ( fRequestNotEmpty ) {
		// register search request result handler
		JabberIqAdd( iqId, IQ_PROC_GETSEARCH, JabberIqResultAdvancedSearch );
		// send request
		JabberSend( jabberThreadInfo->s, iq );
		return iqId;
	}
	return 0;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:54,代码来源:jabber_search.cpp


示例18: test_GetDlgItemText

static void test_GetDlgItemText(void)
{
    char string[64];
    BOOL ret;

    strcpy(string, "Overwrite Me");
    ret = GetDlgItemTextA(NULL, 0, string, sizeof(string)/sizeof(string[0]));
    ok(!ret, "GetDlgItemText(NULL) shouldn't have succeeded\n");

    ok(string[0] == '\0' || broken(!strcmp(string, "Overwrite Me")),
       "string retrieved using GetDlgItemText should have been NULL terminated\n");
}
开发者ID:MichaelMcDonnell,项目名称:wine,代码行数:12,代码来源:dialog.c


示例19: PromptWatchNameProc

LRESULT CALLBACK PromptWatchNameProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) //Gets the description of a watched address
{
	RECT r;
	RECT r2;
	int dx1, dy1, dx2, dy2;

	switch(uMsg)
	{
	case WM_INITDIALOG:

		GetWindowRect(YabWin, &r);
		dx1 = (r.right - r.left) / 2;
		dy1 = (r.bottom - r.top) / 2;

		GetWindowRect(hDlg, &r2);
		dx2 = (r2.right - r2.left) / 2;
		dy2 = (r2.bottom - r2.top) / 2;

		//SetWindowPos(hDlg, NULL, max(0, r.left + (dx1 - dx2)), max(0, r.top + (dy1 - dy2)), NULL, NULL, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
		SetWindowPos(hDlg, NULL, r.left, r.top, NULL, NULL, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
		strcpy(Str_Tmp,"Enter a name for this RAM address.");
		SendDlgItemMessage(hDlg,IDC_PROMPT_TEXT,WM_SETTEXT,0,(LPARAM)_16(Str_Tmp));
		strcpy(Str_Tmp,"");
		SendDlgItemMessage(hDlg,IDC_PROMPT_TEXT2,WM_SETTEXT,0,(LPARAM)_16(Str_Tmp));
		return 1;
		break;

	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDOK:
			{
				GetDlgItemTextA(hDlg,IDC_PROMPT_EDIT,Str_Tmp,80);
				InsertWatch(&rswatches[WatchCount],Str_Tmp);
				EndDialog(hDlg, 1);
				return 1;
				break;
			}
		case ID_CANCEL:
			EndDialog(hDlg, 0);
			return 0;
			break;
		}
		break;

	case WM_CLOSE:
		EndDialog(hDlg, 0);
		return 0;
		break;
	}

	return 0;
}
开发者ID:DavideD,项目名称:BizHawk,代码行数:53,代码来源:ramwatch.cpp


示例20: UpdateSpiralData

//-----------------------------------------------------------------------------
// Name: UpdateCubeData()
// Desc: 
//-----------------------------------------------------------------------------
void UpdateSpiralData( HWND hWnd )
{
    char str[256];

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_WIDTH, str, 256 );
    Settings->m_fBrush_Spiral_Width = (float)atof( str );

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_HEIGHT, str, 256 );
    Settings->m_fBrush_Spiral_Height = (float)atof( str );

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_NUMSTEPS, str, 256 );
    Settings->m_iBrush_Spiral_NumSteps = (int)atof( str );

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_ADDTOFIRST, str, 256 );
    Settings->m_fBrush_Spiral_AddToFirst = (float)atof( str );

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_DEGREES, str, 256 );
    Settings->m_fBrush_Spiral_Degrees = (float)atof( str );

    GetDlgItemTextA( hWnd, IDC_EDIT_SPIRAL_INNERRADIUS, str, 256 );
    Settings->m_fBrush_Spiral_InnerRadius = (float)atof( str );

    if( Settings->m_iBrush_Spiral_NumSteps <= 0 )
        Settings->m_iBrush_Spiral_NumSteps = 1;
}
开发者ID:dandonahoe,项目名称:enigma-editor,代码行数:29,代码来源:SpiralMiniDB.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDlgItemTextW函数代码示例发布时间:2022-05-30
下一篇:
C++ GetDlgItemText函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap