开发者

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

开发者 https://www.devze.com 2023-02-05 10:39 出处:网络
How to pass the h开发者_Python百科andle which I got using spy++ tool in sendmessage? ie. I want to pass this handle

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

精彩评论

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

关注公众号