0

SetWindowLong用来让我的表单点击覆盖。我想创建按钮和一些可点击的元素,但表单应该仍然不可见,因为它是一个覆盖。

我的加载功能:

this.BackColor = Color.Wheat;
this.TransparencyKey = Color.Wheat;
this.TopMost = true;
//this.DoubleBuffered = true;
this.FormBorderStyle = FormBorderStyle.None;

int initialStyle = GetWindowLong(this.Handle, -20);
SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);

GetWindowRect(handle, out rect);
this.Size = new Size(rect.right - rect.left, rect.bottom - rect.top);
this.Top = rect.top;
this.Left = rect.left;

其他一些部分:

public struct RECT
{
    public int left, top, right, bottom;
}

RECT rect;
public const string WINDOW_NAME = "WINDOWNAME_WHATEVER";
IntPtr handle = FindWindow(null, WINDOW_NAME);

我的按钮到底发生了什么,我怎样才能让它工作?

4

0 回答 0