C # contains a struct called intptr, which aims to be the same position as void * In unmanaged world. so it will be 32bit on x32 hardware and OS and be 64bit on x63 platform. so be careful about misusing it with Int. int keeps 4 bytes on any platform.
More:
1. the API function you call must have parameters such as a form handle. When you declare this function, you should explicitly declare it as an intptr type. When declaring WIN32API in C #, you must follow the winapi prototype and do not change its data type.
2. The intptr type is designed as an integer and its size is suitable for a specific platform. That is to say, this type of instance will be 32-bit in 32-bit hardware and operating system, and 64-bit in 64-bit hardware and operating system. the intptr type can be used by languages that support pointers and can be used to reference data between languages that support or do not support pointers. Intptr objects can also be used to keep the handle. For example, intptr instances are widely used in the system. Io. filestream class to maintain file handles.
Reference: http://twt716.blog.163.com/blog/static/320645352009329529191/