Step 1:
Open a DOS promot for launching a special command line. One simple way you can do it would be by clicking Start/Run, typing cmd.
Step 2:
Enter the command line for locking your station:
rundll32.exe user32.dll, LockWorkStation
2014年4月6日 星期日
2014年3月3日 星期一
[Win32] How to get the app owner version?
Example:
CString strResult;
TCHAR szModPath[MAX_PATH];
ZeroMemory(szModPath, sizeof(TCHAR) * MAX_PATH);
GetModuleFileName(NULL, szModPath, sizeof(szModPath));
DWORD dwHandle;
DWORD dwSize = GetFileVersionInfoSize(szModPath, &dwHandle);
if (dwSize > 0)
{
BYTE* pbBuf = static_cast<BYTE*>(alloca(dwSize));
if (GetFileVersionInfo(szModPath, dwHandle, dwSize, pbBuf))
{
UINT uiSize;
BYTE* lpb;
if (VerQueryValue(pbBuf, L"\\VarFileInfo\\Translation", (void**)&lpb, &uiSize))
{
WORD* lpw = (WORD*)lpb;
CString strQuery;
strQuery.Format(L"\\StringFileInfo\\%04x%04x\\ProductVersion", lpw[0], lpw[1]);
if (VerQueryValue(pbBuf, const_cast<LPTSTR>((LPCTSTR)strQuery), (void**)&lpb, &uiSize ) && uiSize > 0)
{
strResult = (LPCTSTR)lpb;
}
}
}
}
CString strResult;
TCHAR szModPath[MAX_PATH];
ZeroMemory(szModPath, sizeof(TCHAR) * MAX_PATH);
GetModuleFileName(NULL, szModPath, sizeof(szModPath));
DWORD dwHandle;
DWORD dwSize = GetFileVersionInfoSize(szModPath, &dwHandle);
if (dwSize > 0)
{
BYTE* pbBuf = static_cast<BYTE*>(alloca(dwSize));
if (GetFileVersionInfo(szModPath, dwHandle, dwSize, pbBuf))
{
UINT uiSize;
BYTE* lpb;
if (VerQueryValue(pbBuf, L"\\VarFileInfo\\Translation", (void**)&lpb, &uiSize))
{
WORD* lpw = (WORD*)lpb;
CString strQuery;
strQuery.Format(L"\\StringFileInfo\\%04x%04x\\ProductVersion", lpw[0], lpw[1]);
if (VerQueryValue(pbBuf, const_cast<LPTSTR>((LPCTSTR)strQuery), (void**)&lpb, &uiSize ) && uiSize > 0)
{
strResult = (LPCTSTR)lpb;
}
}
}
}
[Win32] How to get the OS Version?
DWORD WINAPI GetVersion(void);
Examples:
#include <windows.h>
#include <stdio.h>
void main()
{
DWORD dwVersion = 0;
DWORD dwMajorVersion = 0;
DWORD dwMinorVersion = 0;
DWORD dwBuild = 0;
dwVersion = GetVersion();
// Get the Windows version.
dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
// Get the build number.
if (dwVersion < 0x80000000)
dwBuild = (DWORD)(HIWORD(dwVersion));
printf("Version is %d.%d (%d)\n",
dwMajorVersion,
dwMinorVersion,
dwBuild);
}
2014年1月7日 星期二
[Java, Windows 8] How to transform Java List to Store apps C++/CX?
Java codes:
private static List<String> vv = new ArrayList<String>();
vv.add("area");
vv.add("base");
vv.add("basefont");
vv.add("br");
vv.add("col");
vv.add("frame");
vv.add("hr");
vv.add("img");
vv.add("input");
vv.add("isindex");
vv.add("link");
vv.add("meta");
vv.add("param");
String ss = "hr";
if (vv.contains(ss))
{
/* vv contains ss */
}
else
{
/* vv does not contain xx */
}
private static List<String> vv = new ArrayList<String>();
vv.add("area");
vv.add("base");
vv.add("basefont");
vv.add("br");
vv.add("col");
vv.add("frame");
vv.add("hr");
vv.add("img");
vv.add("input");
vv.add("isindex");
vv.add("link");
vv.add("meta");
vv.add("param");
String ss = "hr";
if (vv.contains(ss))
{
/* vv contains ss */
}
else
{
/* vv does not contain xx */
}
==> Store apps C++/CX
Platform::Collections::Vector<Platform::String^>^ vv = ref new Vector<Platform::String^>();
vv->Append("area");
vv->Append("base");
vv->Append("basefont");
vv->Append("br");
vv->Append("col");
vv->Append("frame");
vv->Append("hr");
vv->Append("img");
vv->Append("input");
vv->Append("isindex");
vv->Append("link");
vv->Append("meta");
vv->Append("param");
unsigned int index = 0;
String^ ss = "hr";
if (vv->IndexOf(ss, &index))
{
/* vv contains ss */
}
else
{
/* vv does not contain xx */
}
2014年1月6日 星期一
[Windows 8] Fixed: error LNK2001: unresolved external symbol _CLSID_FreeThreadedXMLHTTP60
Add msxml6.lib into Project\Properties\Configuration\Properties\Linker\Input\Additional Dependencies
[Windows 8] Fixed: error LNK2019: unresolved external symbol _CreateStreamOverRandomAccessStream@12 ...
Add shcore.lib into Project\Properties\Configuration\Properties\Linker\Input\Additional Dependencies
[Windows 8] Fixed: error C2061: syntax error : identifier 'task'
1. #include <ppltasks.h>
2. using namespace Concurrency;
訂閱:
文章 (Atom)