How can I write screenshots directly in the My Documents folder?

Home / Support / Frequently Asked Questions / How can I write screenshots directly in the My Documents folder?

You're able to pass a filename including a full path to the WriteBMP function. Here is a sample of saving a screenshot in "My Documents" that works on a Pocket PC with Windows Mobile 2003:

Code (12 lines)
  1. //Get the my documents path
  2. TCHAR my_documents_tc[MAX_ESTR];
  3. char my_documents[MAX_ESTR];
  4. SHGetSpecialFolderPath(GetWnd(), my_documents_tc, CSIDL_PERSONAL, FALSE);
  5. ClassEStd::StrCpy(my_documents, my_documents_tc);
  6. ClassEStd::StrCat(my_documents, "\\");
  7.  
  8. //Output surface to file
  9. char newfile[MAX_ESTR];
  10. ClassEStd::StrCpy(newfile, my_documents);
  11. ClassEStd::StrCat(newfile, "screenshot.bmp");
  12. display->buffer.WriteBMP(newfile);

Back to FAQ

Latest forum posts