Aero Glass borders popups in C #

I would like to create popups (fixed size) as follows:

pop-up windows

in my application using C #. I looked in NativeWindow, but I'm not sure if this is the right way to do this. I want the window to behave exactly like the volume control or the “connect to” window in Windows 7

How can I do it?

+5
source share
4 answers

I was able to accomplish this:

if (m.Msg == 0x84 /* WM_NCHITTEST */) {
    m.Result = (IntPtr)1;
    return;
}
base.WndProc(ref m);
+2
source

Using WinForms, create a form and set the following:

Text = "";
FormBorderStyle = Sizable;
ControlBox = false;
MaximizeBox = false;
MinimizeBox = false;
ShowIcon = false;

Edit:

, , . MinimumSize MaximumSize . .

, CreateParams:

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        unchecked
        {
            cp.Style |= (int)0x80000000;    // WS_POPUP
            cp.Style |= 0x40000;            // WS_THICKFRAME
        }
        return cp;
    }
}

, , , . , .

+4

In your CreateParams, specify WS_POPUP and WS_THICKFRAME.

+2
source

To prevent alignment of cursors over the boundary descriptor WM_NCHITTESTand when above the borders, return HTBORDER.

0
source

All Articles