Exemplo n.º 1
0
//レイヤーウィンドウプロシージャ
LRESULT __stdcall LayerWndProc(HWND WindowHandle,UINT Message,WPARAM WParam,LPARAM LParam)
{
	switch (Message){
	case WM_PAINT:
		{
			PAINTSTRUCT PaintStruct;
			BeginPaint(WindowHandle,&PaintStruct);
			std::unique_ptr<Gdiplus::Font> DrawFont(new Gdiplus::Font(L"Tahoma",8));
			std::unique_ptr<Gdiplus::SolidBrush> WhiteBrush(new Gdiplus::SolidBrush(Gdiplus::Color::White)),BlackBrush(new Gdiplus::SolidBrush(Gdiplus::Color::Black));
			std::unique_ptr<Gdiplus::Graphics> LayerWindowGraphics(new Gdiplus::Graphics(WindowHandle));
			std::unique_ptr<Gdiplus::StringFormat> Layout(new Gdiplus::StringFormat(Gdiplus::StringFormatFlagsNoWrap));
			Layout->SetAlignment(Gdiplus::StringAlignment::StringAlignmentFar);
			Layout->SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentFar);
			Layout->SetTrimming(Gdiplus::StringTrimmingNone);
			RECT ClientRect;
			GetClientRect(WindowHandle,&ClientRect);
			Gdiplus::RectF LayoutRect(ClientRect.left,ClientRect.top,ClientRect.right-5,ClientRect.bottom-5);
			std::vector<wchar_t> WindowSize(64,0);
			_itow(ClientRect.right,WindowSize.data(),10);
			auto Null=std::find(WindowSize.begin(),WindowSize.end(),0);
			*Null++=L'\n';
			_itow(ClientRect.bottom,Null._Ptr,10);
			int Count=std::wcslen(WindowSize.data());
			LayerWindowGraphics->DrawString(WindowSize.data(),Count,&*DrawFont,LayoutRect,&*Layout,&*BlackBrush);
			LayoutRect.Inflate(-1,-1);
			LayerWindowGraphics->DrawString(WindowSize.data(),Count,&*DrawFont,LayoutRect,&*Layout,&*WhiteBrush);
			EndPaint(WindowHandle,&PaintStruct);
			break;
		}
	default:
		return DefWindowProc(WindowHandle,Message,WParam,LParam);
	}
	return 0;

}
Exemplo n.º 2
0
void OnInitDlg(HWND hDlg)
{
	LoadSettings();
	UpdateData(DIRECTION, BUTTON, SPEED);
	SetNumTimeReplay(REPLAYTIME);
	Button_SetCheck(GetDlgItem(hDlg, IDC_AUTORUN), AUTORUN);

	OldEditProc = (WNDPROC)GetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRIGHT), GWLP_WNDPROC);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRIGHT), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITLEFT), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITUP), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITDOWN), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITLBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITMBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITWUP), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITWDOWN), GWLP_WNDPROC, (LONG_PTR)NewEditProc);

	TCHAR buffer[100];
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITDOWN), GetKeyName(DIRECTION[DOWN], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITUP), GetKeyName(DIRECTION[UP], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITLEFT), GetKeyName(DIRECTION[LEFT], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITRIGHT), GetKeyName(DIRECTION[RIGHT], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITLBUTTON), GetKeyName(BUTTON[LBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITRBUTTON), GetKeyName(BUTTON[RBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITMBUTTON), GetKeyName(BUTTON[MBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITWUP), GetKeyName(BUTTON[WHEELUP], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITWDOWN), GetKeyName(BUTTON[WHEELDOWN], buffer));

	_itow(SPEED, buffer, 10);
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITSPEED), buffer);
	_itow(REPLAYTIME, buffer, 10);
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITREPLAY), buffer);
}
Exemplo n.º 3
0
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpszCmdLine, int nCmdShow)
{
	srand(time(NULL));
	int randnum;
	int answer;
	wchar_t str1[5];
	do{
		int steps = 0;
		do{
			randnum = rand() % 100 + 1;
			_itow(randnum, str1, 10);
			answer = MessageBox(
				0,
				str1,
				TEXT("Вы загадали это число?"),
				MB_YESNO | MB_ICONQUESTION
				);
			steps++;
		} while (answer != IDYES);
		wchar_t str2[25] = TEXT("Количество попыток: ");
		_itow(steps, str1, 10);
		wcscat(str2, str1);
		answer = MessageBox(
			0,
			TEXT("Хотите попробовать ещё раз?"),
			str2,
			MB_YESNO | MB_ICONQUESTION
			);
	} while (answer != IDNO);
	return 0;
}
Exemplo n.º 4
0
void CReferenceDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	int nMaxVerse;
	wchar_t c[5];
	CSpinButtonCtrl* pSpin;
	CReferenceUtils ref;

	switch(pScrollBar->GetDlgCtrlID())
	{
		case IDC_SPINCHAPTER:
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINCHAPTER);
			m_nChapter=pSpin->GetPos();
			_itow(m_nChapter,c,10);
			m_strChapter=c;
			nMaxVerse=ref.GetMaxVerse(m_nBook,m_nChapter, m_nSourceText, m_pDoc);
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
			pSpin->SetRange(1,nMaxVerse);  //set the verse spinner's range
			pSpin->SetPos(1);                //select first verse
			m_nVerse=1;
			m_strVerse=L"1";
			break;
		case IDC_SPINVERSE:
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
			m_nVerse=pSpin->GetPos();
			_itow(m_nVerse,c,10);
			m_strVerse=c;
			break;
	}
	UpdateData(FALSE);
}
void FiltersDialog::SetStaticData()
{
	UpdateData();
	wchar_t str[255] = {0};
	CountFriquencyValues();
	_high_bound_static.SetWindowText( _itow(_high_bound_value, str, 10) ) ;
	_low_bound_static.SetWindowText( _itow(_low_bound_value, str, 10) ) ;
	_weight_static.SetWindowText( _itow(_weight_value, str, 10) ) ;
}
Exemplo n.º 6
0
INT_PTR CALLBACK AdvancedPageDialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
  if (msg == WM_INITDIALOG) {
    wchar_t txt[10];
    GetPrivateProfileString(L"Advanced", L"HookWindows", L"0", txt, ARRAY_SIZE(txt), inipath);
    Button_SetCheck(GetDlgItem(hwnd,IDC_HOOKWINDOWS), _wtoi(txt)?BST_CHECKED:BST_UNCHECKED);
    GetPrivateProfileString(L"Update", L"CheckOnStartup", L"0", txt, ARRAY_SIZE(txt), inipath);
    Button_SetCheck(GetDlgItem(hwnd,IDC_CHECKONSTARTUP), _wtoi(txt)?BST_CHECKED:BST_UNCHECKED);
    GetPrivateProfileString(L"Update", L"Beta", L"0", txt, ARRAY_SIZE(txt), inipath);
    Button_SetCheck(GetDlgItem(hwnd,IDC_BETA), _wtoi(txt)?BST_CHECKED:BST_UNCHECKED);
  }
  else if (msg == WM_COMMAND) {
    if (wParam == IDC_OPENINI) {
      ShellExecute(NULL, L"open", inipath, NULL, NULL, SW_SHOWNORMAL);
    }
    else {
      wchar_t txt[10];
      int val = Button_GetCheck(GetDlgItem(hwnd,wParam));
      if (wParam == IDC_HOOKWINDOWS) {
        if (val && MessageBox(NULL, l10n->advanced_hookwindows_warn, APP_NAME, MB_ICONINFORMATION|MB_YESNO|MB_TASKMODAL) == IDNO) {
          Button_SetCheck(GetDlgItem(hwnd,IDC_HOOKWINDOWS), BST_UNCHECKED);
          return;
        }
        WritePrivateProfileString(L"Advanced", L"HookWindows", _itow(val,txt,10), inipath);
        UpdateSettings();
      }
      else if (wParam == IDC_CHECKONSTARTUP) {
        WritePrivateProfileString(L"Update", L"CheckOnStartup", _itow(val,txt,10), inipath);
      }
      else if (wParam == IDC_BETA) {
        WritePrivateProfileString(L"Update", L"Beta", _itow(val,txt,10), inipath);
      }
      else if (wParam == IDC_CHECKNOW) {
        CheckForUpdate(1);
      }
    }
  }
  else if (msg == WM_NOTIFY) {
    LPNMHDR pnmh = (LPNMHDR)lParam;
    if (pnmh->code == PSN_SETACTIVE) {
      // Update text
      SetDlgItemText(hwnd, IDC_ADVANCED_BOX,    l10n->advanced_box);
      SetDlgItemText(hwnd, IDC_HOOKWINDOWS,     l10n->advanced_hookwindows);
      SetDlgItemText(hwnd, IDC_CHECKONSTARTUP,  l10n->advanced_checkonstartup);
      SetDlgItemText(hwnd, IDC_BETA,            l10n->advanced_beta);
      SetDlgItemText(hwnd, IDC_CHECKNOW,        l10n->advanced_checknow);
      SetDlgItemText(hwnd, IDC_INI,             l10n->advanced_ini);
      SetDlgItemText(hwnd, IDC_OPENINI,         l10n->advanced_openini);
    }
  }
  return FALSE;
}
Exemplo n.º 7
0
bool change_str(
	const unsigned char num,
	wchar_t* receive_str)
{
	if (num > 0x0f){
		_itow(num, receive_str, 16);
	}
	else {
		*(receive_str) = '0';
		_itow(num, receive_str + 1, 16);
	}

	return true;
}
CString Contact::toString()
{
	TCHAR* tip = new TCHAR();
	_itow( tipContactKey, tip, 10);
	
	return prenume + SEPARATOR + nume + SEPARATOR + telefon + SEPARATOR + tip + SEPARATOR + extraInfo;
}
Exemplo n.º 9
0
void XPath::FuncCollection(const wchar_t* str)
{
	if(!wcscmp(str, L"last"))
	{
		int copyCmdIdx = cmdIdx;
		wchar_t* tempNum = new wchar_t[MAX_CHAR_SIZE];
		_itow(searchNodeQ.size(),tempNum,10);
		wcsncpy(&cmdBuf[cmdIdx-4],tempNum,wcslen(tempNum));
		/*
		while(cmdBuf[copyCmdIdx + 2 + strlen(tempNum)] != '\0')
		{
			cmdBuf[copyCmdIdx-4 + strlen(tempNum)] = cmdBuf[copyCmdIdx + 2 + strlen(tempNum)];
			copyCmdIdx++;
		}
		cmdBuf[copyCmdIdx-3] = '\0';
		cmdIdx = cmdIdx - 5;*/
		delete[] tempNum;
	}
	else if(!wcscmp(str, L"position"))
	{
		wprintf(L"position");
	}
	else
	{
		ErrorCollection(L"FuncName");
	}

	cmdBuf[cmdIdx] = L'\0'; //XPathCmdParser()의 while 반복문 정지시키는 기능.
}
Exemplo n.º 10
0
/*
*函数介绍:线程执行过程
*入口参数:pArg:创建线程时,传进来的参数,这里指的列表框控件指针
*出口参数:(无)
*返回值:这里只返回1。
*/
DWORD  CThreadSynBySemaphoreDlg::ThreadProc(PVOID pArg)
{

	CListBox* pLstBox = (CListBox*)pArg;

	TCHAR buffer[10];
	//等待信号量可用,当信号量计数大于0时,可用
	if (WaitForSingleObject(g_hSynSemaphore,INFINITE) == WAIT_OBJECT_0)
	{

		//给数组赋值
		for (int i=0;i<MAXDATASIZE;i++)
		{
			g_incNum++;  //加1
			g_aGlobalData[i] = g_incNum;  //赋值
			Sleep(5);
		}
		
		//显示已经赋值的数组
		for(int i = 0 ; i < MAXDATASIZE ; i++)
		{
			_itow(g_aGlobalData[i],buffer,10);
			pLstBox->AddString(buffer);  //
		}
	}
	//因为等待函数自动给信号量计数减1
	//所以给信号量计数加1,使信号量继续可用
	ReleaseSemaphore(g_hSynSemaphore,1,NULL);
	return 1;
}
Exemplo n.º 11
0
VOID CProcessManager::FixPath(WCHAR* wzImagePathName)
{
	WCHAR wzBuffer[512] = {0};
	WCHAR wzDrive[26][50] = {0};
	int BlockCount = 0;
	DWORD dwNum = GetLogicalDriveStrings(512,wzBuffer);   //c:\nulld:\nulle:\nullf:\nullnull

	if (dwNum!=0)
	{
		WCHAR* Temp = wzBuffer;
		while (*Temp!=0)
		{
			wcscpy(wzDrive[BlockCount++],Temp);
			Temp=_tcschr(Temp,0)+1;
		}
	}

	for(int i=0;i<BlockCount;i++)
	{
		WCHAR wzTemp[MAX_PATH] = L"\\Device\\HarddiskVolume";
		WCHAR  wzNum[2] = {0};
		 _itow( i,wzNum, 10 );
		wcscat(wzTemp,wzNum);

		if(wcsstr(wzImagePathName,wzTemp)!=NULL)
		{			
			wcscat(wzDrive[i],wzImagePathName+wcslen(wzTemp)+1);
			memset(wzImagePathName,0,wcslen(wzImagePathName)*sizeof(WCHAR));
			wcscpy(wzImagePathName,wzDrive[i]);
			break;
		}

	}

}
Exemplo n.º 12
0
BOOL getScreenSize() {
    int iScreenX = GetSystemMetrics(SM_CXSCREEN);
    int iScreenY = GetSystemMetrics(SM_CYSCREEN);
    DEBUGMSG(1, (L"\ngetScreenSize: x=%i, y=%i\n", iScreenX, iScreenY));
    if(iScreenX>0)
        iScreenWidth=iScreenX;
    if(iScreenY>0)
        iScreenHeight=iScreenY;
    if(iScreenX+iScreenY > 0) {
        _itow(iScreenWidth, sScreenWidth, 10);
        _itow(iScreenHeight, sScreenHeight, 10);
        return TRUE;
    }
    else
        return FALSE;
}
Exemplo n.º 13
0
void MainWindowGrid::Handlers::operator()(TCellData &l)
{
#pragma warning(disable : 4996)
	Log::TData *d = NULL;
	if(Log::IsRow(l.row, d))
	{
		switch(l.col)
		{
		case 0: 
			{
				Log::TData *d0 = NULL;
				if(Log::IsRow(l.row + 1, d0))
				{
					_itow(d->time - d0->time, l.data, 10);
				}
				else
				{
					l.data[0] = '0';
					l.data[1] = '\0';
				}
			//	dprint("row %d", l.row);
			}
			break;
		case 1:
			char buf[1024];
			LogMess::FactoryMessages::Instance().Text(d->id, buf, d->value);
			
			int len = 1 + strlen(buf);
			MultiByteToWideChar(1251, 0, buf, len, l.data, len);			
			break;
		}
	}
}
Exemplo n.º 14
0
void CQuickLaunch::SaveLaunchItems(HKEY hKey, list<LaunchItem*>* pLaunchItems)
{
	WCHAR wzName[MAX_PATH];
	DWORD dwName = sizeof(wzName);
	DWORD dwType;
	int index = 0;

	while (ERROR_SUCCESS == RegEnumValue(hKey, index, wzName, &dwName, NULL, &dwType, NULL, NULL))
	{
		dwName = sizeof(wzName);
		RegDeleteValue(hKey, wzName);
	}
	int count = pLaunchItems->size();
	RegistrySetDWORD(hKey, NULL, L"Count", count);

	index = 0;
	list<LaunchItem*>::iterator iter = pLaunchItems->begin();

	while (iter != pLaunchItems->end())
	{
		WCHAR wzPath[10], wzCount[5];
		DWORD dwSize = 0;
		_itow(index, wzCount, 10);

		StringCchCopy(wzPath, ARRAYSIZE(wzPath), wzCount);
		StringCchCat(wzPath, ARRAYSIZE(wzPath), L"_Path");

		LaunchItem* pRecord = *iter;
		RegistrySetString(hKey, NULL, wzPath, pRecord->wzPath);

		iter++;
		index++;
	}
}
Exemplo n.º 15
0
ULONG
OptionAdvancedCommit(
	IN HWND hWnd
	)
{
	PMDB_DATA_ITEM Item;
	int Checked;
	BOOLEAN Enable;
	WCHAR Buffer[MAX_PATH];

	//
	// Enable kernel tracing, valid only for native 32 bits system
	// 

	if (!BspIs64Bits && !BspIsWow64) {

		Item = MdbGetData(MdbEnableKernel);
		ASSERT(Item != NULL);

		Checked = IsDlgButtonChecked(hWnd, IDC_CHECK_ENABLE_KERNEL);
		Enable = (Checked == BST_CHECKED) ? TRUE : FALSE;

		_itow(Enable, Buffer, 10);
		if (wcsicmp(Buffer, Item->Value) != 0) {
			MdbSetData(MdbEnableKernel, Buffer);
		}

	}

	return S_OK;
}
Exemplo n.º 16
0
int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
{
	DBVARIANT dbv = { 0 };
	WCHAR *wc;
	int len;

	if (Value && length >= 10 && !GetSetting(hContact, szModule, szSetting, &dbv)) {
		switch (dbv.type) {
		case DBVT_UTF8:
			len = (int)strlen(dbv.pszVal) + 1;
			wc = (WCHAR*)_alloca(length*sizeof(WCHAR));
			MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, wc, len);
			wcsncpy((WCHAR*)Value, wc, length);
			break;

		case DBVT_ASCIIZ:
			len = (int)strlen(dbv.pszVal) + 1;
			wc = (WCHAR*)_alloca(len*sizeof(WCHAR));
			MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, wc, len);
			wcsncpy((WCHAR*)Value, wc, length);
			break;

		case DBVT_DWORD:
			_itow(dbv.dVal, Value, 10);
			break;

		case DBVT_BYTE:
			_itow(dbv.bVal, Value, 10);
			break;

		case DBVT_WORD:
			_itow(dbv.wVal, Value, 10);
			break;
		}

		db_free(&dbv);

		Value[length - 1] = 0;
		return 1;
	}

	if (Value)
		Value[0] = 0;

	return 0;
}
Exemplo n.º 17
0
wchar_t* MusicUtils::ConverI2W(int i)
{
	wchar_t *st;
	st= (wchar_t*)malloc(_MAX_PATH);
	ZeroMemory(st,wcslen(st));
	_itow(i,st,10);
	return st;
}
Exemplo n.º 18
0
std::wstring ButtonManage::GetWidth(int wid)
{
  if (wid == MAXINT)
    return L"MAXINT";
  wchar_t s[10];
  _itow(wid, s, 10);
  return s;
}
Exemplo n.º 19
0
std::wstring
tzf::ParameterInt::get_value_str (void)
{
  wchar_t str [32];
  _itow (value, str, 10);

  return std::wstring (str);
}
Exemplo n.º 20
0
ULONG CExMapi::GetContactCount()
{	
	BOOL doLog = m_pCtrl->IsEnableLog();
	if(doLog)
	{
		m_logHelper.LogPAB(L"------------------------------------");
		m_logHelper.LogPAB(L"Function GetPABCotactCount START:");
		m_logHelper.LogPAB(L"------------------------------------");
	}

	ULONG count = 0;
	LPMAPIFOLDER pFolder = NULL;
	LPMAPITABLE lpMsgStoreTable = NULL;
	lpMsgStoreTable = GetMessageStoresTable();	
	CString strFolder;
	int msgStoreCount = 0;
	wchar_t buffer[5];
	while(OpenNextMessageStore(lpMsgStoreTable))
	{			
		//pFolder = GetContactCount(OpenRootFolder(),count);			

		msgStoreCount++;
		_itow(msgStoreCount,buffer,10);
		if(doLog)
		{
			if(msgStoreCount > 1)
				m_logHelper.LogPAB(L"-------------------------------------");
			m_logHelper.LogPAB(L"Message Store No : "+CString(buffer));
			m_logHelper.LogPAB(L"-------------------------------------");
		}

		pFolder = OpenContacts();
		if(pFolder && IsContactFolder(pFolder))
		{
			strFolder = GetFolderName(pFolder);
			if(GetContents(pFolder))
			{
				count += GetRowCount();
			}		
			pFolder = GetContactCount(pFolder,count,doLog);
		}		
		if(m_pCtrl->IsPABContactCoutningAbort())
			break;
		__recursionCount = 0;
	}
	if(doLog)
	{
		m_logHelper.LogPAB(L"------------------------------------");
		m_logHelper.LogPAB(L"Function GetPABCotactCount END:");
		m_logHelper.LogPAB(L"------------------------------------");	
		m_logHelper.ClosePABLog();
	}
	__recursionCount = 0;
	RELEASE(lpMsgStoreTable);		
	
	return count;
}
Exemplo n.º 21
0
wchar_t* FdoCommonOSUtil::itow(int value, wchar_t* buffer, size_t bufferSize)
{
#ifdef _WIN32
    return _itow(value, buffer, 10); // radix is always 10
#else
    swprintf(buffer, bufferSize, L"%d", value);
    return buffer;
#endif
}
Exemplo n.º 22
0
STDMETHODIMP [!output CLASS_NAME]::GetPropValueName (LONG index, BSTR *pBstrValueName) {
	if ( pBstrValueName == NULL )
		return (E_POINTER) ;
	// TODO: add your code here (and comment the 2 lines below)
	WCHAR buffer [5] ; //----- This should be enough
	*pBstrValueName =::SysAllocString (_itow (index, buffer, 10)) ; //----- Show simply the numbers in the combo

	return (S_OK) ;
}
Exemplo n.º 23
0
std::wstring ButtonManage::RectToString(CRect& rc)
{
  wchar_t s[10];
  std::wstring str;
  int left = rc.left;
  _itow(left, s, 10);
  str =str + s + L",";
  int top  = rc.top;
  _itow(top, s, 10);
  str =str + s + L",";
  int right = rc.right;
  _itow(right, s, 10);
  str =str + s + L",";
  int bottom = rc.bottom;
  _itow(bottom, s ,10);
  str += s;

  return str;
}
Exemplo n.º 24
0
void Communicator::GetPipeNameStr(WCHAR ** buff,DWORD pid)
{
	WCHAR path[10];
	WCHAR  pid_str[10];
	wcscpy(path,L"\\\\.\\pipe\\");
	_itow(pid,pid_str,10);
	*buff=new WCHAR[20];
	wcscpy(*buff,path);
	wcscpy(*buff+9,pid_str);
}
BOOL AP_Win32Dialog_Columns::_onDeltaPos(NM_UPDOWN * pnmud)
{
	wchar_t buf[BUFSIZE];
	UT_Win32LocaleString str;
    
	switch( pnmud->hdr.idFrom )
	{
	case AP_RID_DIALOG_COLUMN_SPIN_NUMCOLUMNS:
		if( pnmud->iDelta < 0 )
		{
			setColumns( getColumns() + 1 );
		}
		else
		{
			if( getColumns() > 1 )
			{
				setColumns( getColumns() - 1 );
			}
		}
		SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_NUMCOLUMNS, _itow(getColumns(),buf,10));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_ONE, (getColumns()==1));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_TWO, (getColumns()==2));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_THREE, (getColumns()==3));
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_SPACEAFTER:
		if( pnmud->iDelta < 0 )
		{
			incrementSpaceAfter( true );
		}
		else
		{
			incrementSpaceAfter( false );
		}
        str.fromUTF8 (getSpaceAfterString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_SPACEAFTER, str.c_str ());
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_MAXSIZE:
		if( pnmud->iDelta < 0 )
		{
			incrementMaxHeight( true );
		}
		else
		{
			incrementMaxHeight( false );
		}
        str.fromUTF8 (getHeightString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_MAXSIZE, str.c_str ());
		return 1;

	default:
		return 0;
	}
}
Exemplo n.º 26
0
void PhpBB::write_message(const int topic_id, const wstring &text)
{
    wchar_t topic[10];
    _itow(topic_id, topic, 10);
    wstring action = L"message="+text+L"&attach_sig=on&mode=reply&sid="+m_sid+L"&disable_bbcode=&disable_smilies=&t="+topic+L"&post=Отправить";
    if(http.post(TEXT("forum/posting.php"), action.c_str()))
    {
        wstring str =  http.getData();
        int a = 0;
    }
}
Exemplo n.º 27
0
DWORD ReadAddrMap(DWORD Addr)
{
	//TCHAR buffer[20];
	DWORD IP;
	wchar_t buildingString[20],UnitString[20];
	LPCTSTR Building,Unit;
	DWORD build_temp,Unit_temp;
	build_temp=(Addr>>22)&(0x3ff);
	Unit_temp=(Addr>>16)&(0x3f);
	ZeroMemory(buildingString,sizeof(buildingString));
	ZeroMemory(UnitString,sizeof(UnitString));
	//_itoa(build_temp,buildingString,10);
	_itow(build_temp,buildingString,10);
	Building=(LPCTSTR)buildingString;
	//_itoa(Unit_temp,UnitString,10);
	_itow(Unit_temp,UnitString,10);
	Unit=(LPCTSTR)UnitString;
	IP=(DWORD)CeGetPrivateProfileInt(Building, Unit, -1, _T("\\UserDev\\SysSet.ini"));
	return IP;
}
Exemplo n.º 28
0
wstring IToWString(const int input,int _radix)
{
	wstring ret;

	wchar_t *temp = new wchar_t[30];
	_itow(input,temp,_radix);
	ret = temp;
	delete[] temp;

	return ret;
}
Exemplo n.º 29
0
	void	cCurve::RenderPointIndex()
	{
		if( !cGameApp::m_spGlyphFontRender )
			return;
		int	l_iNumPoint = (int)m_OriginalPointList.size();
		if( l_iNumPoint == -1 )
			return;
		wchar_t	l_str[TEMP_SIZE];
		for(int i=0;i<l_iNumPoint;++i)
		{
			_itow(i,l_str,10);
			cGameApp::m_spGlyphFontRender->RenderFont((int)m_OriginalPointList[i].x-10,(int)m_OriginalPointList[i].y,l_str);
		}
	}
Exemplo n.º 30
0
void CReferenceDlg::LoadBooks()
{
	int i,nMaxBooks;
	CString T;
	wchar_t c[5];
	CWnd* pWnd;
	CReferenceUtils ref;

	m_cboBook.ResetContent();   //clear contents of drop list box
	nMaxBooks=ref.GetMaxBook(m_nSourceText,m_pDoc);
	for (i=1;i<=nMaxBooks;i++)
	{
		T=ref.GetBookName(i, m_nSourceText,m_pDoc);
		m_cboBook.AddString(T);
	}
	m_ncboBook=m_nBook-1;    //initialize selected book
	CSpinButtonCtrl* pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINCHAPTER);
	i=ref.GetMaxChapter(m_nBook, m_nSourceText); //get num of chapters in book
	pSpin->SetRange(1,i);   
	pSpin->SetPos(m_nChapter);         //select chapter
	_itow(m_nChapter,c,10);
	m_strChapter=c;
	pWnd=GetDlgItem(IDC_SPINCHAPTER);
	if (i==1) pWnd->EnableWindow(FALSE);    //if only one chapter in book, disable
	else pWnd->EnableWindow(TRUE);

	pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
	i=ref.GetMaxVerse(m_nBook, m_nChapter, m_nSourceText, m_pDoc);   //get verses in this chapter
	pSpin->SetRange(1,i);     
	pSpin->SetPos(m_nVerse);  
	_itow(m_nVerse,c,10);
	m_strVerse=c;
	pWnd=GetDlgItem(IDC_SPINVERSE);
	if (i==1) pWnd->EnableWindow(FALSE);    //if only one chapter in book, disable
	else pWnd->EnableWindow(TRUE);
	UpdateData(FALSE);
}