发表于 2015-5-18 06:58:07

win7方面API學習

  Getting Applicateion Data Folder Paths Win32
  #include
  //link with shell32.lib
  PWSTRpSzFolderPath = NULL;
  if(succeeded(SHGetKnownFolderPath(
  FOLDERID_ProgramData,0,NULL,&pSzFolderPath))
  {
  CoTaskMemFree(pSzFolderPath);
  }
  关于什么时候使用CoTaskMemAlloc/CoTaskMemFree来申请/释放内存
  也就是说,如果需要调用COM接口,并且接口中有的参数,且类型不是整形或浮点数之类的基本数据类型,就需要调用CoTaskMemAlloc来申请这块内存,并使用完毕后调用CoTaskMemFree来释放。
  setting the Application ID
  Process-wide-affects all windows in the process:
  #include
  #pragma comment(lib,"shell32.lib")
  SetCurrentProcessExplicitAppUserModelId(L"Microsoft.Samples.AppId1");
  Windows7Application.SetCurrentProcessAppId("Microsoft.Samples.AppId1")
页: [1]
查看完整版本: win7方面API學習