Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to scroll Window in other process with Win32API
    primarykey
    data
    text
    <p>Im trying to create a program where I can send some process id of a process (that may be firefox, ie, notepad etc) to a method that scrolls window of the process.</p> <p>I have been trying with GetScrollBarInfo and SetScrollPos which I found at pinvoke without any success. Im not sure if this is the right way or not. I started playing with GetScrollBarInfo, but it doesn't seem to work.</p> <p>I tried the code found at <a href="http://www.pinvoke.net/default.aspx/user32.getscrollbarinfo" rel="nofollow">http://www.pinvoke.net/default.aspx/user32.getscrollbarinfo</a></p> <pre><code>[StructLayout(LayoutKind.Sequential)] public struct SCROLLBARINFO { public int cbSize; public Rectangle rcScrollBar; public int dxyLineButton; public int xyThumbTop; public int xyThumbBottom; public int reserved; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public int[] rgstate; } private const uint OBJID_HSCROLL = 0xFFFFFFFA; private const uint OBJID_VSCROLL = 0xFFFFFFFB; private const uint OBJID_CLIENT = 0xFFFFFFFC; private int Scroll(int ProcessID) { IntPtr handle = Process.GetProcessById(ProcessID).MainWindowHandle; SCROLLBARINFO psbi = new SCROLLBARINFO(); psbi.cbSize = Marshal.SizeOf(psbi); int nResult = GetScrollBarInfo(handle, OBJID_CLIENT, ref psbi); if (nResult == 0) { int nLatError = Marshal.GetLastWin32Error(); } } </code></pre> <p>GetLastWin32Error() returns errorcode 122 which means "The data area passed to a system call is too small", according to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx</a></p> <p>Im not sure what I do wrong. How can I solve this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload