1
0

string.cpp 699 B

12345678910111213141516171819202122232425262728293031323334
  1. #define STRICT
  2. #include <windows.h>
  3. #include <stdio.h>
  4. #include "string_unicode.h"
  5. void string_a::s_GetWindowText(HWND w)
  6. {
  7. reset();
  8. int len=GetWindowTextLengthA(w)+1;
  9. GetWindowTextA(w,string_buffer_a(*this,len),len);
  10. }
  11. void string_a::s_SetWindowText(HWND w)
  12. {
  13. SetWindowTextA(w,*this);
  14. }
  15. /*bool string_a::reg_read(HKEY hk,const char * name)
  16. {
  17. DWORD sz=0,t=0;
  18. if (RegQueryValueExA(hk,name,0,&t,0,&sz)!=ERROR_SUCCESS) return 0;
  19. if (sz==0 || t!=REG_SZ) return 0;
  20. RegQueryValueExA(hk,name,0,0,(BYTE*)buffer_get(sz),&sz);
  21. buffer_done();
  22. return 1;
  23. }
  24. void string_a::reg_write(HKEY hk,const char * name)
  25. {
  26. RegSetValueExA(hk,name,0,REG_SZ,(const BYTE*)(const char*)*this,(length()+1));
  27. }
  28. */