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