運行之後的界面:
BOOL CWndExDlg::OnInitDialog() { CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here m_List.InsertColumn(0,_T("窗口類名"),LVCFMT_LEFT,100); m_List.InsertColumn(1,_T("窗口標題"),LVCFMT_LEFT,100); return TRUE; // return TRUE unless you set the focus to a control } void CWndExDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialog::OnSysCommand(nID, lParam); } } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CWndExDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CWndExDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } void CWndExDlg::OnBtnMax() { //最大化窗口 SendMessage(WM_SYSCOMMAND,SC_MAXIMIZE,0); } void CWndExDlg::OnBtnMin() { //最小化 SendMessage(WM_COMMAND,SC_MINIMIZE,0); } void CWndExDlg::OnBtnRebuild() { //恢復窗口 SendMessage(WM_SYSCOMMAND,SC_RESTORE,0); } void CWndExDlg::OnBtnSwp() { //設置窗口的大小和位置 SetWindowPos(NULL,0,0,300,300,SWP_NOZORDER); //SWP_NOZORDER 表示當前的層次 } void CWndExDlg::OnBtnMove() { // 設置窗口的大小和位置 MoveWindow(100,200,200,320); } void CWndExDlg::OnBtnCenter() { //居中 CenterWindow(); } void CWndExDlg::OnBtnTopshow() { SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE); /* SWP_NOMOVE 表示窗口保持當前的位置,忽略x,y. SWP_NOSIZE 表示窗口當前保持的大小,忽略,cx,cy */ } void CWndExDlg::OnBtnGet() { CString strText=_T(""); //獲取窗口標題 GetWindowText(strText); SetDlgItemText(IDC_EDIT,strText); } void CWndExDlg::OnBtnSet() { CString strText=_T(""); GetDlgItemText(IDC_EDIT,strText); //設置窗口標題 SetWindowText(strText); } void CWndExDlg::OnBtnMinall() { //獲取任務窗口 CWnd* pWnd=CWnd::FindWindow(_T("Shell_TrayWnd"),NULL); //發送ID爲0X1F5(WIN+M)的WM_HOTKEY Message pWnd->SendMessage(WM_HOTKEY,0X1F5); } void CWndExDlg::OnBtnHid() { //獲取任務欄窗口 CWnd* pWnd=CWnd::FindWindow(_T("Shell_TrayWnd"),NULL); //隱藏窗口 if (pWnd->IsWindowVisible()) { pWnd->ShowWindow(SW_HIDE); } } void CWndExDlg::OnBtnApp() { //獲取任務欄窗口 CWnd* pWnd=CWnd::FindWindow(_T("Shell_TrayWnd"),NULL); //顯示窗口 if (!pWnd->IsWindowVisible()) { pWnd->ShowWindow(SW_SHOW); } } void CWndExDlg::OnBtnOne() { m_List.DeleteAllItems(); m_List.SetRedraw(FALSE); //獲取桌面窗口 CWnd* pDeskTopWnd=CWnd::GetDesktopWindow(); //獲取第一個子窗口 CWnd* pWnd=pDeskTopWnd->GetWindow(GW_CHILD); while(pWnd!=NULL) { int nItem=m_List.GetItemCount(); //獲取窗口類名 CString strClassName=_T(""); ::GetClassName(pWnd->GetSafeHwnd(),strClassName.GetBuffer(256),256); strClassName.ReleaseBuffer(); m_List.InsertItem(nItem,strClassName); //獲取窗口標題 CString strWindowText=_T(""); ::GetWindowText(pWnd->GetSafeHwnd(),strWindowText.GetBuffer(256),256); strWindowText.ReleaseBuffer(); m_List.SetItemText(nItem,1,strWindowText); //繼續下一個 pWnd=pWnd->GetWindow(GW_HWNDNEXT); } m_List.SetRedraw(TRUE); } void CWndExDlg::OnBtnTwo() { //m_List.DeleteAllItems(); // m_List.SetRedraw(FALSE); //枚舉窗口 // ::EnumWndProc(EnumWndProc,(LPARAM)m_List); }
下載地址:http://ishare.iask.sina.com.cn/f/14454291.html
前提 你必須會創建aspire項目,不會的請先看微服務新體驗之Aspire初體驗 Aspirate (Aspir8) Aspirate 是將aspire項目發佈到k8s集羣的工具 安裝aspirate dotnet tool install
安裝配置相關軟件 安裝 PowerShell 7 / Core dotnet tool install --global PowerShell 安裝 Visual Studio 擴展 Microsoft Child Process Deb
前言 今天給大家分享一個.NET開源(MIT License)、免費、跨平臺(適用於 Windows、MacOS 和 Linux )、使用簡單的面部識別庫:FaceRecognitionDotNet。 項目介紹 FaceRecogniti
本週刊由 Python貓 出品,精心篩選國內外的 250+ 信息源,爲你挑選最值得分享的文章、教程、開源項目、軟件工具、播客和視頻、熱門話題等內容。願景:幫助所有讀者精進 Python 技術,並增長職業和副業的收入。 本期週刊分享了 12
官方安裝指南 https://developer.hashicorp.com/terraform/install https://developer.hashicorp.com/terraform/intro/getting-sta
LQR 是一種優化控制方法,設計目標是找到一組控制輸入,使得線性系統的狀態軌跡儘可能地接近目標,同時使控制輸入儘可能小。其目標函數是一個二次型成本函數。 分爲以下幾個步驟: 1. 設系統動態方程爲: 其中x爲狀態量,u爲控制輸入,A和B爲
Most commonly used tags in HTML Last Updated : 08 Mar, 2024 Most commonly used tags in HTML refer to HTM
https://www.w3schools.com/css/css_math_functions.asp The CSS math functions allow mathematical expressions to be used
CSS tutorials (w3school) https://www.schoolsw3.com/css/index.php (Русский язык) https://www.w3schools.com/css/css_intro
https://www.w3schools.com/css/css_important.asp What is !important? The !important rule in CSS is used to add more imp
https://www.w3schools.com/css/css_website_layout.asp Website Layout A website is often divided into headers, menus, co
https://www.w3schools.com/css/css_form.asp The look of an HTML form can be greatly improved with CSS: <!DOCTYPE html>
https://www.w3schools.com/css/css_counters.asp CSS counters are "variables" maintained by CSS whose values can be inc
https://zhuanlan.zhihu.com/p/670589063 CSS Specificity(CSS 特異性)是一個用來決定當多個CSS規則應用於同一個元素時,哪個規則將優先應用的機制。 What is Specific
https://www.w3schools.com/css/css_units.asp CSS Units CSS has several different units for expressing a length. Many CS