在LRESULT SendMessage( HWND hWnd, // handle of destination window UINT Msg, // message to send WPARAM wParam, // first message parameter LPARAM lParam // second message parameter)中,LPARAM是一个32位的数值。但却可以传给它一个地址值,因为地址值也是32位。 #include <stdio.h>
void main()
{ char a[]="a good test about string to long"; long b=(long)a; printf("%s",b);}
结果为:a good test about string to long
由此可见printf中的%s打印出的结果是按地址来进行的,也实现了string到long的强制类型转换。