使用双窗口
This commit is contained in:
38
demo/QQ/mainForm.cpp
Normal file
38
demo/QQ/mainForm.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#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()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user