开发者

How to pass the handle fetched from spy++ in sendmessage using c#?

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜