PInvokes - int to IntPtr

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Im fairly new to the world of PInvokes and I just want to make sure Ive got some of the basics right! Firstly am I right in assuming you should always try and use IntPtr values when passing to PInvokes so it will work on 32bit and 64 bit? Secondly I want to know how to convert an int to IntPtr.

Basically Im using Spy++ to look at messages being passed to a window. I notice that (IntPtr)<font size=2>0x00000001 </font>is being passed in and this equals 184 some how (mouse button press x-coord)? and (IntPtr)<font size=2>0x006300B8 is 99... I just need to know how to convert random ints into these types of 8 bit numbers.

Any help or pointers on this matter will be greatly appreciated.
Thanks.</font>

View the full article
 
Back
Top