Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
956 B

  1. // Test program for new font query stuff
  2. #include <windows.h>
  3. #include <stdio.h>
  4. #include <process.h>
  5. #include "psqfont.h"
  6. int __cdecl main()
  7. {
  8. PS_QUERY_FONT_HANDLE hFontQ;
  9. DWORD dwNumFonts;
  10. TCHAR szFont[500];
  11. TCHAR szFile[500];
  12. DWORD dwSizeFont;
  13. DWORD dwSizeFile;
  14. DWORD i;
  15. if (PsBeginFontQuery(&hFontQ) != PS_QFONT_SUCCESS ) {
  16. printf("\nPsbegin font query failed");
  17. exit(1);
  18. }
  19. if( PsGetNumFontsAvailable( hFontQ, &dwNumFonts) != PS_QFONT_SUCCESS){
  20. printf("\nPsGetNumFontsAvailable failed");
  21. PsEndFontQuery(hFontQ);
  22. exit(1);
  23. }
  24. // now enum the fonts
  25. for (i = 0 ; i < dwNumFonts;i++ ) {
  26. dwSizeFont = sizeof(szFont);
  27. dwSizeFile = sizeof(szFile);
  28. PsGetFontInfo( hFontQ, i, szFont, &dwSizeFont, szFile, &dwSizeFile);
  29. printf("\n%s %d ::::: %s %d", szFont,dwSizeFont,szFile,dwSizeFile);
  30. }
  31. PsEndFontQuery(hFontQ);
  32. return(0);
  33. }