Пример #1
0
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;
}
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; 
}
Пример #3
0
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;
}
Пример #4
0
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();
	}
}
Пример #5
0
INT_PTR MainDlg::OnExecute( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    wchar_t path[MAX_PATH] = { 0 };
    char init[256] = { 0 };
    wchar_t arg[512] = { 0 };

    GetDlgItemTextW( hDlg, IDC_IMAGE_PATH, path, MAX_PATH );
    GetDlgItemTextA( hDlg, IDC_INIT_EXPORT, init, 256 );
    GetDlgItemTextW( hDlg, IDC_ARGUMENT, arg, 512 );

    DoInject( path, init, arg );

    return (INT_PTR)TRUE;
}
Пример #6
0
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;
}
Пример #7
0
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;
}
Пример #8
0
/* 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;
    }
}
Пример #9
0
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;
}
Пример #10
0
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;
}
Пример #11
0
void CRemotePtpLogin::OnBnClickedButtonLoginOk()
{
	// TODO: Add your control notification handler code here
	CString temp_serial_number;
	CString temp_user_name;
	CString temp_password;
	GetDlgItemTextW(IDC_EDIT_LOGIN_USER_NAME,temp_user_name);
	GetDlgItemTextW(IDC_EDIT_LOGIN_PASSWORD,temp_password);
		GetDlgItemTextW(IDC_EDIT_LOGIN_SERIAL_NUMBER,temp_serial_number);
	remote_connect_serial_number = (unsigned int)_wtoi(temp_serial_number);
	memset(ptpLoginName,0,30);
	memset(ptpLoginPassword,0,20);
	WideCharToMultiByte( CP_ACP, 0, temp_user_name.GetBuffer(), -1, ptpLoginName, 30, NULL, NULL );
	WideCharToMultiByte( CP_ACP, 0, temp_password.GetBuffer(), -1, ptpLoginPassword, 20, NULL, NULL );
	PostMessage(WM_CLOSE,NULL,NULL);
}
Пример #12
0
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;
}
Пример #13
0
/***********************************************************************
 *                              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;
}
Пример #14
0
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);
}
Пример #15
0
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;
}
Пример #16
0
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);
	}
}
Пример #17
0
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;
}
Пример #18
0
void RadarSetupDlg_FollowAssist_OnApply( HWND hDlg )
{
	// follow sets
	g_game_client->ai.folAsiCfg.m_follow_enable = IsDlgButtonChecked( hDlg, IDC_C_FOLLOW_ENABLE );
	g_game_client->ai.folAsiCfg.m_follow_dist = (int)GetDlgItemInt( hDlg, IDC_E_FOLLOW_DISTANCE, NULL, FALSE );
	GetDlgItemTextW( hDlg, IDC_E_NAME_FOLLOW, g_game_client->ai.folAsiCfg.m_follow_name, 127 );
	g_game_client->ai.folAsiCfg.m_follow_only_in_party = IsDlgButtonChecked( hDlg, IDC_C_FOLLOW_ONLY_IN_PARTY );
	// assist sets
	g_game_client->ai.folAsiCfg.m_assist_enable = IsDlgButtonChecked( hDlg, IDC_C_ASSIST_ENABLE );
	GetDlgItemTextW( hDlg, IDC_E_NAME_ASSIST, g_game_client->ai.folAsiCfg.m_assist_name, 127 );
	g_game_client->ai.folAsiCfg.m_assist_only_in_party = IsDlgButtonChecked( hDlg, IDC_C_ASSIST_ONLY_IN_PARTY );
	g_game_client->ai.folAsiCfg.m_assist_dont_ally = IsDlgButtonChecked( hDlg, IDC_C_DONT_ASSIST_ALLIES );
	// save config to file
	g_game_client->ai.folAsiCfg.saveToFile( "L2Detect_folAsi.ini" );
	// checks
	if( !g_game_client->ai.folAsiCfg.m_follow_enable )
		g_game_client->ai.followDisable(); // zero follow objectID
	if( !g_game_client->ai.folAsiCfg.m_assist_enable )
		g_game_client->ai.assistDisable(); // zero assist objectID
}
Пример #19
0
/*雷射歸零*/
void CLaserDlg::OnBnClickedBtnzero()
{
	((CCommandTestDlg*)pMain)->a.m_Action.LA_SetZero();
    ((CCommandTestDlg*)pMain)->HeightLaserZero = ((CCommandTestDlg*)pMain)->a.m_Action.g_HeightLaserZero;
    ((CCommandTestDlg*)pMain)->LaserOffsetz = ((CCommandTestDlg*)pMain)->a.m_Action.g_OffSetLaserZ;
    CString StrBuff,StrBuff1;
    GetDlgItemTextW(IDC_STALASERTOTIP, StrBuff);
    StrBuff1.Format(_T(",%d,%d"), ((CCommandTestDlg*)pMain)->HeightLaserZero, ((CCommandTestDlg*)pMain)->LaserOffsetz);
    StrBuff = StrBuff + StrBuff1;
    SetDlgItemText(IDC_STALASERTOTIP, StrBuff);
}
void CRegisterMonitorDlg::OnBnClickedButton1()
{

	// TODO: Add your control notification handler code here

	CString cs_write;
	GetDlgItemTextW(IDC_EDIT_WRITE,cs_write.GetBuffer(MAX_PATH),MAX_PATH);
	cs_write.ReleaseBuffer();
	write_value = _wtoi(cs_write);

	PostThreadMessage(nThreadID,WM_WRITE_REG,0,0);
}
Пример #21
0
static int edittext_toi(HWND hWnd, int field)
{
	WCHAR buf[512]; buf[511] = 0;
	GetDlgItemTextW(hWnd,field,buf,509);
	StdStrBuf data(buf);
	const char* bufp = data.getData();
	while(*bufp == ' ') ++bufp;
	int res = strtol(bufp, NULL, 0);
	if(errno != ERANGE)
		return res;
	return -1;
}
Пример #22
0
static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
{
    static const WCHAR percent_u[] = {'%','u',0};
    static const WCHAR percent_x[] = {'%','x',0};

    WCHAR buf[128];
    DWORD val;

    if (!GetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf, COUNT_OF(buf))) return FALSE;
    if (!swscanf(buf, toHex ? percent_u : percent_x, &val)) return FALSE;
    wsprintfW(buf, toHex ? percent_x : percent_u, val);
    return SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf);
}
Пример #23
0
void CAddBuddyDlg::OnOK()
{
    WCHAR	wcStr[256];
    SESSION_DATA	*pData;
    DWORD	dwIPAddr = 0;


    if (m_cBuddyURI.IsBlank())
    {   // No IP Address entered
        MessageBox ( "Please Enter an IP Address for the buddy person." );
        return;
    }

    pData = (SESSION_DATA *)GetWindowLongPtr ( ::GetWindow (m_hWnd, GW_OWNER), GWL_USERDATA);

    GetDlgItemTextW ( m_hWnd, IDC_BUDDYNAME, wcStr, 256 );

    if (wcslen (wcStr) == 0)
    {
        MessageBox ( "Please enter the Buddy Name" );
        return;
    }

    pData->bstrName = SysAllocString(_T(wcStr));


    GetDlgItemTextW ( m_hWnd, IDC_BUDDYURI, wcStr, 256 );

    if (wcslen (wcStr) == 0)
    {
        MessageBox ( "Please enter the Buddy URI" );
        return;
    }

    pData->bstrURI = SysAllocString ( _T(wcStr) );

    CDialog::OnOK();
}
void OFFBDSWS_OnApply( HWND hDlg )
{
	//log_error( LOG_OK, "OFFBDSWS_OnApply\n" );
	int c = IsDlgButtonChecked( hDlg, IDC_C_INVBD );
	if( c ) rsobdsws->inv_bd_enable = 1;
	else rsobdsws->inv_bd_enable = 0;
	c = IsDlgButtonChecked( hDlg, IDC_C_INVSWS );
	if( c ) rsobdsws->inv_sws_enable = 1;
	else rsobdsws->inv_sws_enable = 0;
	//
	GetDlgItemTextW( hDlg, IDC_E_BDNAME, rsobdsws->nameBD, 63 );
	GetDlgItemTextW( hDlg, IDC_E_SWSNAME, rsobdsws->nameSWS, 63 );
	//
	rsobdsws->inv_bd_secs = GetDlgItemInt( hDlg, IDC_E_INV_BD_SEC, NULL, TRUE );
	rsobdsws->inv_sws_secs = GetDlgItemInt( hDlg, IDC_E_INV_SWS_SEC, NULL, TRUE );
	//
	rsobdsws->dismiss_bd_secs = GetDlgItemInt( hDlg, IDC_E_DISMISS_BD_SEC, NULL, TRUE );
	rsobdsws->dismiss_sws_secs = GetDlgItemInt( hDlg, IDC_E_DISMISS_SWS_SEC, NULL, TRUE );
	//
	// apply setup immediately
	g_game_client->ai.setOffpartyBDSWS_Config( rsobdsws );
	//rsobdsws->saveToFile( "L2Detect_offp_BDSWS.ini" );
}
bool XAP_Win32DialogBase::getDlgItemText(int nIDDlgItem, UT_Win32LocaleString& str)
{	
	wchar_t szBuff [1024];	
	bool rslt;
	
	rslt = (bool) GetDlgItemTextW(m_hDlg, nIDDlgItem, szBuff, 1024);
	
	if (rslt == true)
		str.fromLocale(szBuff);
	else
		str.clear();
	
	return rslt;
 }
Пример #26
0
static void hugsprim_GetDlgItemTextW_14(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsInt arg2;
    HsPtr arg3;
    HsInt arg4;
    HsInt res1;
    arg1 = hugs->getPtr();
    arg2 = hugs->getInt();
    arg3 = hugs->getPtr();
    arg4 = hugs->getInt();
    res1 = GetDlgItemTextW(arg1, arg2, arg3, arg4);
    hugs->putInt(res1);
    hugs->returnIO(hugs_root,1);
}
Пример #27
0
/***********************************************************************
 *                              FD31_StripEditControl        [internal]
 * Strip pathnames off the contents of the edit control.
 */
static void FD31_StripEditControl(HWND hwnd)
{
    WCHAR temp[BUFFILE], *cp;

    GetDlgItemTextW( hwnd, edt1, temp, sizeof(temp)/sizeof(WCHAR));
    cp = strrchrW(temp, '\\');
    if (cp != NULL) {
	strcpyW(temp, cp+1);
    }
    cp = strrchrW(temp, ':');
    if (cp != NULL) {
	strcpyW(temp, cp+1);
    }
    /* FIXME: shouldn't we do something with the result here? ;-) */
}
void CRegisterMonitorDlg::OnCbnSelchangeCombo2()
{
	// TODO: Add your control notification handler code here
	if(!m_port_open)
		MessageBox(_T("Please Open the Com port"));
	UpdateData(TRUE);

	sel_item=m_combo_reg.GetCurSel();
	CString temp_cs;
	switch(sel_item)
	{
	case 0:
		temp_cs.Format(_T("%d"),m_reg_address1);
		write_register = m_reg_address1;
		break;
	case 1:
		temp_cs.Format(_T("%d"),m_reg_address2);
		write_register = m_reg_address2;
		break;
	case 2:
		temp_cs.Format(_T("%d"),m_reg_address3);
		write_register = m_reg_address3;
		break;
	case 3:
		temp_cs.Format(_T("%d"),m_reg_address4);
		write_register = m_reg_address4;
		break;
	case 4:
		temp_cs.Format(_T("%d"),m_reg_address5);
		write_register = m_reg_address5;
		break;
	default:
		break;
	}

	SetDlgItemTextW(IDC_EDIT_WRITE,_T(""));

	SetDlgItemTextW(IDC_STATIC_REGISTER_WRITE,temp_cs);

	CString cs_write;
	GetDlgItemTextW(IDC_EDIT_WRITE,cs_write.GetBuffer(MAX_PATH),MAX_PATH);
	cs_write.ReleaseBuffer();
	write_value = _wtoi(cs_write);

	//if(hWriteThread==NULL)


}
bool XAP_Win32DialogBase::getDlgItemText(HWND hWnd, int nIDDlgItem, UT_Win32LocaleString& str)
{	
	UT_return_val_if_fail(IsWindow(hWnd), false);
	
	wchar_t szBuff [1024];	
	bool rslt;
	
	rslt = (bool) GetDlgItemTextW(hWnd, nIDDlgItem, szBuff, 1024);
	
	if (rslt == true)
		str.fromLocale(szBuff);
	else
		str.clear();
	
	return rslt;
}
Пример #30
0
static
INT_PTR
CALLBACK
GinaLoadFailedWindowProc(
    IN HWND hwndDlg,
    IN UINT uMsg,
    IN WPARAM wParam,
    IN LPARAM lParam)
{
    switch (uMsg)
    {
        case WM_COMMAND:
        {
            switch (LOWORD(wParam))
            {
                case IDOK:
                    EndDialog(hwndDlg, IDOK);
                    return TRUE;
            }
            break;
        }

        case WM_INITDIALOG:
        {
            int len;
            WCHAR templateText[MAX_PATH], text[MAX_PATH];

            len = GetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, templateText, MAX_PATH);
            if (len)
            {
                wsprintfW(text, templateText, (LPWSTR)lParam);
                SetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, text);
            }

            SetFocus(GetDlgItem(hwndDlg, IDOK));
            return TRUE;
        }

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

    return FALSE;
}