win7方麵API學習
Getting Applicateion Data Folder Paths Win32
#include <shlobj.h>
//link with shell32.lib
PWSTR pSzFolderPath = NULL;
if(succeeded(SHGetKnownFolderPath(
FOLDERID_ProgramData,0,NULL,&pSzFolderPath))
{
CoTaskMemFree(pSzFolderPath);
}
關於什麼時候使用CoTaskMemAlloc/CoTaskMemFree來申請/釋放內存
也就是說,如果需要調用COM接口,並且接口中有[out]的參數,且類型不是整形或浮點數之類的基本數據類型,就需要調用CoTaskMemAlloc來申請這塊內存,並使用完畢後調用CoTaskMemFree來釋放。
setting the Application ID
Process-wide-affects all windows in the process:
#include <windows.h>
#pragma comment(lib,"shell32.lib")
SetCurrentProcessExplicitAppUserModelId(L"Microsoft.Samples.AppId1");
Windows7Application.SetCurrentProcessAppId("Microsoft.Samples.AppId1")
最後更新:2017-04-03 14:53:38