SetWindowPos returns Access Denied

2019-07-21 16:09发布

I'am building app that helps taking screenshots of selected windows. I'am displaying semi-transparent form over selected window. I'am using winapi in this case.

[DllImport("user32.dll", SetLastError = true)]

public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter,
                                       int X, int Y, int cx, int cy, int uFlags);

First parameter is handle to transparent form, to second I'am passing handle to selected window. Everything working just fine except one thing. When selected window is running with Administrator privileges I'am getting error "Access denied". Ofcourse, my app is running without administrator privileges and it need to stay that way.

Do you have any ideas how to fix this?

0条回答
登录 后发表回答