C# 알림창 폼
출처 : http://crynut84.tistory.com/47
public partial class NotifyForm : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int SystemParametersInfo(int uAction, int uParam, out RECT lpvParam, int fuWinIni);
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
public NotifyForm()
{
InitializeComponent();
this.TopLevel = true;
}
private void SetFormLocationToTray(Form form)
{
int SPI_GETWORKAREA = 0x0030; //작업영역을 알아오는 Flag
RECT r = new RECT();
SystemParametersInfo(SPI_GETWORKAREA, 0, out r, 0);
Size s = form.Size;
Point p = new Point(r.right - s.Width, r.bottom - s.Height);
form.Location = p;
}
private void NotifyForm_Load(object sender, EventArgs e)
{
SetFormLocationToTray(this);
}
}