How to pass the h开发者_Python百科andle which I got using spy++ tool in sendmessage? ie. I want to pass this handle
Handle Got from spy++ 00010540
in this function
SendMessage(buttonHandle, WM_HSCROLL, (IntPtr)SB_LINERIGHT, IntPtr.Zero);
where button handle is of type IntPtr.I want to substitute buttonhandle with the above value. Thanks
Just new IntPtr(0x00010540)
should work. For example like this:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(
IntPtr hWnd,
UInt32 Msg,
IntPtr wParam,
IntPtr lParam);
SendMessage(
new IntPtr(0x00010540),
0x0112, // WM_SYSCOMMAND
new IntPtr(0xF020), // SC_MINIMIZE
IntPtr.Zero);
精彩评论