Question

How to pass the handle 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

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top