From e8ec9137055017f9d951b87d7b46b92a4eaf23bc Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Fri, 31 Dec 2021 11:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AA=97=E5=8F=A3=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/proto_debuger/base_form.cpp | 19 ++++++++++++++++++- examples/proto_debuger/main.cpp | 5 ++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/proto_debuger/base_form.cpp b/examples/proto_debuger/base_form.cpp index b7fb7498..1ed7caa6 100644 --- a/examples/proto_debuger/base_form.cpp +++ b/examples/proto_debuger/base_form.cpp @@ -8,7 +8,7 @@ BasicForm::BasicForm(): mMonitorNewSelect(nullptr), mRightShow(nullptr) { - + this->SetInitSize(1024, 768, true, false); } BasicForm::~BasicForm() @@ -30,10 +30,13 @@ std::wstring BasicForm::GetWindowClassName() const { return kClassName; } + int gTcpServerCnt = 0; int gTcpClientCnt = 0; LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { + wprintf(L"recv message 0x%x\r\n", uMsg); + if (uMsg == WM_ADD_UART_CLOSE) { wprintf(L"close %s\r\n", ((wstring*)wParam)->c_str()); mRightShow->SetVisible(false); @@ -300,6 +303,20 @@ void BasicForm::InitWindow(){ mRightSide->RemoveAll(); + this->SetMinInfo(1024, 768, true); + this->SetInitSize(1024, 768, false, false); + ui::UiRect maxRect = GetMaximizeInfo(); + + this->Invalidate(maxRect); + + RECT rc; + //取当前窗口区域 + GetClientRect(m_hWnd, &rc); + //改变窗口大小 + + //移动窗口到指定区域 + ::MoveWindow(m_hWnd, rc.left, rc.top, rc.right, rc.bottom, true); + } LRESULT BasicForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) diff --git a/examples/proto_debuger/main.cpp b/examples/proto_debuger/main.cpp index 8f426e7c..dec82286 100644 --- a/examples/proto_debuger/main.cpp +++ b/examples/proto_debuger/main.cpp @@ -90,9 +90,12 @@ void MainThread::Init() auto dpiManager = ui::DpiManager::GetInstance(); // 创建一个默认带有阴影的居中窗口 BasicForm* window = new BasicForm(); - window->Create(NULL, BasicForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & WS_SIZEBOX, 0); + + window->Create(NULL, BasicForm::kClassName.c_str(), + WS_OVERLAPPEDWINDOW & WS_SIZEBOX,0,true, ui::UiRect(0,0,1024,768)); window->CenterWindow(); window->ShowWindow(); + window->SetInitSize(1024,768); } void MainThread::Cleanup()