39 lines
743 B
C++
39 lines
743 B
C++
#include "mainForm.h"
|
|
|
|
void MainForm::OnNotify(Control* sender, EventArgs& args)
|
|
{
|
|
if (args.EventType == Event::OnMouseDown) {
|
|
if (sender->Name == "btnMin") {
|
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
|
}
|
|
else if (sender->Name == "btnMax") {
|
|
if (IsZoomed(Hwnd())) {
|
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_RESTORE, 0);
|
|
}
|
|
else {
|
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_MAXIMIZE, 0);
|
|
}
|
|
}
|
|
else if (sender->Name == "btnClose") {
|
|
Close();
|
|
}
|
|
}
|
|
__super::OnNotify(sender, args);
|
|
}
|
|
|
|
void MainForm::OnClose(bool& close)
|
|
{
|
|
Application::Exit();
|
|
}
|
|
|
|
MainForm::MainForm() : LayeredWindow(800, 600)
|
|
{
|
|
SetText(L"QQ主界面");
|
|
umg.LoadXml("res/mainForm.htm");
|
|
umg.SetupUI(this);
|
|
}
|
|
|
|
MainForm::~MainForm()
|
|
{
|
|
}
|