Just do a cast. But be careful about PostMessage function. Since it is asynchronous, you must make sure that the pointer you send will remain valid after you exit from the calling function.
if you want a synchronous call. Or just make sure the pointer you send remains valid (allocate it with
, or keep it as a member variable of your class).