You can search the header files and find there
typedef void* HANDLE;
Those. HANDLE is nothing more than void* .
You can use C ++ tools and display this type:
cout << typeid(HANDLE).name() << endl;
You will see
void *
Those. your HANDLE is just a pointer, and you can do everything with a regular pointer with it. Just knowing what and why :)
You can store it in a string by translating it into the appropriate string representation. Type
char s[20]; HANDLE h; sprintf(s,"%p",h);
Or even just as the original byte sequence:
unsigned char s[4]; HANDLE h; memcpy(s,&h,sizeof(h));
In variables of type int , of course, if the dimensions allow (in the 64-bit world, void* - 8 bytes) - using explicit type conversion reinterpret_cast
HANDLE f; int g = reinterpret_cast<int>(f);
Only you need to understand what you are doing and why. Otherwise, you can get in trouble at the loving adventure point ...