本文整理汇总了C++中wsprintfW函数的典型用法代码示例。如果您正苦于以下问题:C++ wsprintfW函数的具体用法?C++ wsprintfW怎么用?C++ wsprintfW使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wsprintfW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: even_thread_cs
unsigned _stdcall even_thread_cs(void *p)
{
for( int i = 0 ; i < MAX ; i++ )
{
EnterCriticalSection(&cs);
if( shared_value % 2 == 0 )
{
printf("\n%d", i);
wchar_t buffer[256];
wsprintfW(buffer, L"%d", i);
::MessageBox(NULL, buffer , L"Even Dlg title", MB_OK);
}
LeaveCriticalSection(&cs);
}
return 0;
}
示例2: wsprintfW
HRESULT CMediaViewer::AddToRot(IUnknown *pUnkGraph, DWORD *pdwRegister) const
{
// デバッグ用
IMoniker * pMoniker;
IRunningObjectTable *pROT;
if(FAILED(::GetRunningObjectTable(0, &pROT)))return E_FAIL;
WCHAR wsz[256];
wsprintfW(wsz, L"FilterGraph %08p pid %08x", (DWORD_PTR)pUnkGraph, ::GetCurrentProcessId());
HRESULT hr = ::CreateItemMoniker(L"!", wsz, &pMoniker);
if(SUCCEEDED(hr)){
hr = pROT->Register(0, pUnkGraph, pMoniker, pdwRegister);
pMoniker->Release();
}
pROT->Release();
return hr;
}
示例3: GenMD5Code
VOID WINAPI GenMD5Code(const WCHAR* FileName, wstring& OutHex)
{
BYTE OutBuffer[16] = { 0 };
MD5Context Context;
MD5Init(&Context);
MD5Update(&Context, (BYTE*)FileName, lstrlenW(FileName) * 2);
MD5Final(OutBuffer, &Context);
WCHAR OutTemp[3] = { 0 };
for (ULONG32 i = 0; i < 16; i++)
{
wsprintfW(OutTemp, L"%x", (OutBuffer[i] & 0xF0) >> 4);
OutHex += OutTemp;
RtlZeroMemory(OutTemp, 0, sizeof(wchar_t)* 3);
wsprintfW(OutTemp, L"%x", OutBuffer[i] & 0x0F);
OutHex += OutTemp;
RtlZeroMemory(OutTemp, 0, sizeof(wchar_t)* 3);
}
}
示例4: COMCAT_GetCategoryDesc
/**********************************************************************
* COMCAT_GetCategoryDesc
*/
static HRESULT COMCAT_GetCategoryDesc(HKEY key, LCID lcid, PWCHAR pszDesc,
ULONG buf_wchars)
{
static const WCHAR fmt[] = { '%', 'l', 'X', 0 };
WCHAR valname[5];
HRESULT res;
DWORD type, size = (buf_wchars - 1) * sizeof(WCHAR);
if (pszDesc == NULL) return E_INVALIDARG;
/* FIXME: lcid comparisons are more complex than this! */
wsprintfW(valname, fmt, lcid);
res = RegQueryValueExW(key, valname, 0, &type, (LPBYTE)pszDesc, &size);
if (res != ERROR_SUCCESS || type != REG_SZ) {
FIXME("Simplified lcid comparison\n");
return CAT_E_NODESCRIPTION;
}
pszDesc[size / sizeof(WCHAR)] = 0;
return S_OK;
}
示例5: e3d_get_process_key
HRESULT e3d_get_process_key(BYTE * key)
{
int len = 4;
wchar_t pid[100];
wsprintfW(pid, L"%d", GetCurrentProcessId());
HKEY hkey = NULL;
int ret = RegOpenKeyExW(HKEY_CURRENT_USER, e3d_soft_key,0,STANDARD_RIGHTS_REQUIRED |KEY_READ , &hkey);
if (ret != ERROR_SUCCESS || hkey == NULL)
return E_FAIL;
unsigned char * p_key_got = NULL;
RegQueryValueExW(hkey, pid, 0, NULL, (LPBYTE)&p_key_got, (LPDWORD)&len);
RegCloseKey(hkey);
if (p_key_got)
memcpy(key, p_key_got, 32);
return e3d_del_process_key();
}
示例6: wsprintfW
// Adds a DirectShow filter graph to the Running Object Table,
// allowing GraphEdit to "spy" on a remote filter graph.
HRESULT CBDAFilterGraph::AddGraphToRot(
IUnknown *pUnkGraph,
DWORD *pdwRegister
)
{
CComPtr <IMoniker> pMoniker;
CComPtr <IRunningObjectTable> pROT;
WCHAR wsz[128];
HRESULT hr;
if (FAILED(GetRunningObjectTable(0, &pROT)))
return E_FAIL;
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph,
GetCurrentProcessId());
hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr))
hr = pROT->Register(0, pUnkGraph, pMoniker, pdwRegister);
return hr;
}
示例7: ExcelException
std::string excelreader::GetDataAsString(int row, int col) {
if (row < 0 || col < 0)
throw ExcelException("Cell not exit");
WCHAR szTmp[6];
wsprintfW(szTmp, L"%i", row);
std::wstring sTmp = GetColumnName(col) + szTmp + L":"
+ GetColumnName(col) + szTmp;
_variant_t parm(sTmp.c_str());
_variant_t result;
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlSheet, L"Range",
1, (VARIANT)parm);
_variant_t data;
AutoWrap(DISPATCH_PROPERTYGET, &data, result.pdispVal, L"Value", 0);
//if (VariantChangeType(&data, &data, 0, VT_BSTR) != S_OK) {
// throw ExcelException("Cannot convert data to string");
//}
//CW2A ansiBuffer((_bstr_t)data);
//CT2A cc((_bstr_t)data);
//std::string s(cc);
return tostr(data);
}
示例8: IPADDRESS_SetAddress
static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address)
{
WCHAR buf[20];
static const WCHAR fmt[] = { '%', 'd', 0 };
int i;
TRACE("\n");
for (i = 3; i >= 0; i--) {
IPPART_INFO* part = &infoPtr->Part[i];
int value = ip_address & 0xff;
if ( (value >= part->LowerLimit) && (value <= part->UpperLimit) ) {
wsprintfW (buf, fmt, value);
SetWindowTextW (part->EditHwnd, buf);
IPADDRESS_Notify (infoPtr, EN_CHANGE);
}
ip_address >>= 8;
}
return TRUE;
}
示例9: SysMouseWImpl_GetObjectInfo
/******************************************************************************
* GetObjectInfo : get information about a device object such as a button
* or axis
*/
static HRESULT WINAPI SysMouseWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow)
{
static const WCHAR x_axisW[] = {'X','-','A','x','i','s',0};
static const WCHAR y_axisW[] = {'Y','-','A','x','i','s',0};
static const WCHAR wheelW[] = {'W','h','e','e','l',0};
static const WCHAR buttonW[] = {'B','u','t','t','o','n',' ','%','d',0};
HRESULT res;
res = IDirectInputDevice2WImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow);
if (res != DI_OK) return res;
if (IsEqualGUID(&pdidoi->guidType, &GUID_XAxis)) strcpyW(pdidoi->tszName, x_axisW);
else if (IsEqualGUID(&pdidoi->guidType, &GUID_YAxis)) strcpyW(pdidoi->tszName, y_axisW);
else if (IsEqualGUID(&pdidoi->guidType, &GUID_ZAxis)) strcpyW(pdidoi->tszName, wheelW);
else if (pdidoi->dwType & DIDFT_BUTTON)
wsprintfW(pdidoi->tszName, buttonW, DIDFT_GETINSTANCE(pdidoi->dwType) - 3);
_dump_OBJECTINSTANCEW(pdidoi);
return res;
}
示例10: UPDOWN_SetBuddyInt
/***********************************************************************
* UPDOWN_SetBuddyInt
* Tries to set the pos to the buddy window based on current pos
* returns:
* TRUE - if it set the caption of the buddy successfully
* FALSE - if an error occurred
*/
static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
{
WCHAR fmt[3] = { '%', 'd', '\0' };
WCHAR txt[20];
int len;
if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy)))
return FALSE;
TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal);
/*if the buddy is a list window, we must set curr index */
if (UPDOWN_IsBuddyListbox(infoPtr)) {
return SendMessageW(infoPtr->Buddy, LB_SETCURSEL, infoPtr->CurVal, 0) != LB_ERR;
}
/* Regular window, so set caption to the number */
if (infoPtr->Base == 16) fmt[1] = 'X';
len = wsprintfW(txt, fmt, infoPtr->CurVal);
/* Do thousands separation if necessary */
if (!(infoPtr->dwStyle & UDS_NOTHOUSANDS) && (len > 3)) {
WCHAR tmp[COUNT_OF(txt)], *src = tmp, *dst = txt;
WCHAR sep = UPDOWN_GetThousandSep();
int start = len % 3;
memcpy(tmp, txt, sizeof(txt));
if (start == 0) start = 3;
dst += start;
src += start;
for (len=0; *src; len++) {
if (len % 3 == 0) *dst++ = sep;
*dst++ = *src++;
}
*dst = 0;
}
return SetWindowTextW(infoPtr->Buddy, txt);
}
示例11: AddGraphToRot
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister)
{
IMoniker * pMoniker;
IRunningObjectTable *pROT;
WCHAR wsz[128];
HRESULT hr;
if (FAILED(GetRunningObjectTable(0, &pROT))) {
return E_FAIL;
}
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph,
GetCurrentProcessId());
hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr)) {
hr = pROT->Register(0, pUnkGraph, pMoniker, pdwRegister);
pMoniker->Release();
}
pROT->Release();
return hr;
}
示例12: wsprintfW
void SDesktopDock::OnLButtonUp(UINT nFlags, CPoint point)
{
for (int i=0; i<MAX_COUNT; i++)
{
if (m_RTRect[i].PtInRect(point))
{
TCHAR chTemp[MAX_PATH]=_T("");
wsprintfW(chTemp,TEXT("索引===%d号"), i);
SMessageBox(NULL,chTemp,L"多点WIFI",MB_OK);
if (i==0){
ShellExecute(NULL, L"open",L"http://www.wf06.com", NULL, NULL, SW_SHOWNORMAL);
}else if (i==1){
ShellExecute(NULL, L"open",L"http://www.sk53.com", NULL, NULL, SW_SHOWNORMAL);
}
return ;
}
}
}
示例13: wsprintfW
// Function name : CVMR9Graph::AddToRot
// Description : let the graph instance be accessible from graphedit
// Return type : HRESULT
// Argument : IUnknown *pUnkGraph
// Argument : DWORD *pdwRegister
HRESULT CVMR9Graph::AddToRot(IUnknown *pUnkGraph)
{
if (pUnkGraph == NULL) {
return E_INVALIDARG;
}
IMoniker * pMoniker;
IRunningObjectTable *pROT;
if (FAILED(GetRunningObjectTable(0, &pROT))) {
return E_FAIL;
}
WCHAR wsz[256];
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId());
HRESULT hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr)) {
hr = pROT->Register(0, pUnkGraph, pMoniker, &m_dwRotId);
pMoniker->Release();
}
pROT->Release();
return hr;
}
示例14: ucmWusaExtractPackage
/*
* ucmWusaExtractPackage
*
* Purpose:
*
* Extract cab to protected directory using wusa.
*
*/
BOOL ucmWusaExtractPackage(
LPWSTR lpCommandLine
)
{
BOOL bResult = FALSE;
WCHAR szMsuFileName[MAX_PATH * 2];
WCHAR szCmd[MAX_PATH * 4];
RtlSecureZeroMemory(szMsuFileName, sizeof(szMsuFileName));
_strcpy(szMsuFileName, g_ctx.szTempDirectory);
_strcat(szMsuFileName, ELLOCNAK_MSU);
//extract msu data to target directory
RtlSecureZeroMemory(szCmd, sizeof(szCmd));
wsprintfW(szCmd, lpCommandLine, szMsuFileName);
bResult = supRunProcess(L"cmd.exe", szCmd);
if (szMsuFileName[0] != 0) {
DeleteFileW(szMsuFileName);
}
return bResult;
}
示例15: CreateValue
BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPWSTR valueName)
{
LONG lRet = ERROR_SUCCESS;
WCHAR newValue[256];
DWORD valueDword = 0;
BOOL result = FALSE;
int valueNum;
HKEY hKey;
lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ | KEY_SET_VALUE, &hKey);
if (lRet != ERROR_SUCCESS) {
error_code_messagebox(hwnd, lRet);
return FALSE;
}
if (!LoadStringW(GetModuleHandleW(0), IDS_NEWVALUE, newValue, COUNT_OF(newValue))) goto done;
/* try to find out a name for the newly create key (max 100 times) */
for (valueNum = 1; valueNum < 100; valueNum++) {
wsprintfW(valueName, newValue, valueNum);
lRet = RegQueryValueExW(hKey, valueName, 0, 0, 0, 0);
if (lRet == ERROR_FILE_NOT_FOUND) break;
}
if (lRet != ERROR_FILE_NOT_FOUND) {
error_code_messagebox(hwnd, lRet);
goto done;
}
lRet = RegSetValueExW(hKey, valueName, 0, valueType, (BYTE*)&valueDword, sizeof(DWORD));
if (lRet != ERROR_SUCCESS) {
error_code_messagebox(hwnd, lRet);
goto done;
}
result = TRUE;
done:
RegCloseKey(hKey);
return result;
}