Qt for Windows message loops, LIBQXT analysis, and WinCE accelerator processing

Source: Internet
Author: User

Qt for Windows message loops, LIBQXT analysis, and WinCE accelerator processing

Using QT to do Windows graphics interface development compared to MFC, the personal feeling is relatively simple and useful: first Use the designer tool to make a UI file, then write a few signals and slots in the program, and then load the UI file, and finally the interface is done.

In the interface development, the shortcut key processing certainly is essential. Now using the open source third-party processing class: Libqxt. It offers cross-platform solutions: Win and X11. It is also very convenient to use. The use of convenience is not everything, we must have the spirit of seeking: "Know it and know its why." Okay, crap, not much. Start analysis.

Windows programming is always guided by its own mechanism, and detailed instructions are given in the Windows Programming book. The classic Windows program example (hello Windows) is given below:

#include

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (hinstance hinstance, HInstance hprevinstance,

PSTR szcmdline, int icmdshow)

{

Static TCHAR szappname[] = TEXT ("Hellowin");

HWND hwnd;

MSG msg;

Wndclaswndclass;

Wndclass.style = Cs_hredraw | Cs_vredraw;

Wndclass.lpfnwndproc = WndProc;

Wndclass.cbclsextra = 0;

Wndclass.cbwndextra = 0;

Wndclass.hinstance = hinstance;

Wndclass.hicon = LoadIcon (NULL, idi_application);

Wndclass.hcursor = LoadCursor (NULL, Idc_arrow);

Wndclass.hbrbackground= (Hbrush) getstockobject (White_brush);

Wndclass.lpszmenunam = NULL;

Wndclass.lpszclassname= Szappname;

if (! RegisterClass (&wndclass)) {

MessageBox (NULL, TEXT ("This program requires Windows nt!"),

Szappname, Mb_iconerror);

return 0;

}

hwnd = CreateWindow (szappname,//window class name

TEXT ("The Hello Program"),//Window caption

Ws_overlappedwindow,//Window style

cw_usedefault,//Initial x position

cw_usedefault,//Initial y position

cw_usedefault,//Initial x size

cw_usedefault,//Initial y size

Http://www.360docs.net/doc/info-dd3b0c3faf45b307e8719777.html

Https://wenku.baidu.com/view/dd3b0c3faf45b307e8719777.html

Qt for Windows message loops, LIBQXT analysis, and WinCE accelerator processing

Related Article

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.