Files
EzUI/demo/QQ/mainForm.cpp

39 lines
743 B
C++
Raw Permalink Normal View History

2026-01-26 18:36:55 +08:00
#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()
{
}