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.

40 lines
816 B

  1. #include "xerox.h"
  2. #include "pos.h"
  3. BOOL GetLastPosition(
  4. RECT *prc)
  5. {
  6. HKEY hKey;
  7. DWORD dwType = 0;
  8. DWORD cb;
  9. if (ERROR_SUCCESS !=
  10. RegOpenKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Xerox", &hKey)) {
  11. return(FALSE);
  12. }
  13. RegQueryValueEx(hKey, "Position", 0, &dwType, (LPSTR)prc, &cb);
  14. if (dwType != REG_BINARY || cb != sizeof(RECT)) {
  15. RegCloseKey(hKey);
  16. return(FALSE);
  17. }
  18. RegCloseKey(hKey);
  19. return(TRUE);
  20. }
  21. BOOL SetLastPosition(
  22. RECT *prc)
  23. {
  24. HKEY hKey;
  25. if (ERROR_SUCCESS !=
  26. RegCreateKey(HKEY_CURRENT_USER,
  27. "Software\\Microsoft\\Xerox", &hKey)) {
  28. return(FALSE);
  29. }
  30. RegSetValueEx(hKey, "Position", 0, REG_BINARY, (LPSTR)prc, sizeof(RECT));
  31. RegCloseKey(hKey);
  32. return(TRUE);
  33. }
  34.