Advertisement
Guest User

SetPropW

a guest
Sep 8th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. int __stdcall f(HWND Wnd, LPARAM L) {
  5.     SetLastError(ERROR_SUCCESS);
  6.     int Success = SetPropW(Wnd, L"asdf", (HANDLE) 0xdeadbeef);
  7.     int Error = GetLastError();
  8.  
  9.     wchar_t Class[500] = {'\0'};
  10.     GetClassNameW(Wnd, Class, 500);
  11.  
  12.     printf("window %x: %S\n", Wnd, Class);
  13.     printf("\tsuccess: %u\n", Success);
  14.     printf("\terror: %u\n", Error);
  15.     printf("\tprop: %x\n\n", (unsigned) GetPropW(Wnd, L"asdf"));
  16.     return 1;
  17. };
  18.  
  19. void main() {
  20.     EnumDesktopWindows(0, f, 0);
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement