小编xor*_*mer的帖子

C# - user32.dll - GetWindowRect问题

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetWindowRect(HandleRef hWnd, out RECT lpRect);

[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
    public int Left;        // x position of upper-left corner
    public int Top;         // y position of upper-left corner
    public int Right;       // x position of lower-right corner
    public int Bottom;      // y position of lower-right corner
}

foreach (Process pr in Process.GetProcesses())
{
    RECT rc;
    GetWindowRect(???, out rc);
Run Code Online (Sandbox Code Playgroud)

我该怎么做"???"?.它告诉我我必须放置一个HandleRef对象,但我不知道如何从Process方法获取HandleRef对象.

c# c#-4.0

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

c#-4.0 ×1