Duilib Learning two first programs Hello world

Source: Internet
Author: User
Tags set background

Duilib Learning two first programs Hello world

#pragma once#include <uilib.h>using namespace duilib; #ifdef _debug# ifdef _unicode# pragma comment (lib, "Dui  Lib_ud.lib ") # else# pragma comment (lib," Duilib_d.lib ") # endif#else# ifdef _unicode# pragma comment (lib, "Duilib_u.lib") # else# pragma comment (lib, "DuiLib.lib") # Endif#endifclass Cduiframewnd:public Cwindowwnd, PU    Blic inotifyui{public:virtual LPCTSTR getwindowclassname () const {return _t ("Duimainframe");}    virtual void Notify (tnotifyui& msg) {} virtual LRESULT handlemessage (UINT umsg, WPARAM WPARAM, LPARAM LPARAM)        {LRESULT lres = 0;            if (umsg = = wm_create) {Ccontrolui *pwnd = new Cbuttonui;   Pwnd->settext (_t ("Hello World"));       Set text Pwnd->setbkcolor (0XFF00FF00);            Set Background color m_paintmanager.init (m_hwnd);            M_paintmanager.attachdialog (PWND);        return lres; } if (M_paintmanager.messagehandler (umsg, WParam, LParAM, Lres)) {return lres;    } return __super::handlemessage (umsg, WParam, LParam); }protected:cpaintmanagerui M_paintmanager;}; int Apientry _tWinMain (hinstance hinstance, hinstance hprevinstance, LPTSTR lpcmdline, int ncmdshow) {cpaintmanagerui::    Setinstance (HINSTANCE);    Cduiframewnd Duiframe;    Duiframe.create (NULL, _t ("Duiwnd"), Ui_wndstyle_frame, Ws_ex_windowedge);    Duiframe.showmodal (); return 0;}

1, the mouse moved to the customer area (green section), the mouse style will become the hand type 2, resizing and maximizing the window, Hello world will adapt to the size of the window, has been centered 3, if you want to change the background color, call SetBkColor directly.

Duilib Learning two first programs Hello world

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.