这段C++是什么意思?
static bool CreateMainWindow() {
LoadLibrary(TEXT("Riched20.dll"));
INITCOMMONCONTROLSEX ccx;
ccx.dwSize = sizeof(INITCOMMONCONTROLSEX);
ccx.dwICC = ICC_TAB_CLASSES;
InitCommonControlsEx(&ccx);
InitializeClass(&PaintBoxWndProc, "PaintBox");
InitializeClass(&GraphBoxWndProc, "GraphBox");
InitializeClass(&AdvancedBoxWndProc, "AdvancedBox");
InitializeClass(&TwoFactorEditFieldWndProc, "TwoFactorEditField");
HDC dc = GetDC(0);
g_large_fonts = GetDeviceCaps(dc, LOGPIXELSX);
ReleaseDC(0, dc);
g_message_taskbar_created = RegisterWindowMessage(TEXT("TaskbarCreated"));
g_icons[0] = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
g_icons[1] = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON0));
g_ui_window = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, &DlgProc);
if (!g_ui_window)
return false;
DragAcceptFiles(g_ui_window, TRUE);
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
ChangeWindowMessageFilter(WM_USER + 10, MSGFLT_ADD);
TCITEM tabitem;
HWND hwnd_tab = GetDlgItem(g_ui_window, IDC_TAB);
hwndTab = hwnd_tab;
tabitem.mask = TCIF_TEXT;
tabitem.pszText = "Logs";
TabCtrl_InsertItem(hwnd_tab, 0, &tabitem);
tabitem.pszText = "Charts";
TabCtrl_InsertItem(hwnd_tab, 1, &tabitem);
tabitem.pszText = "Advanced";
TabCtrl_InsertItem(hwnd_tab, 2, &tabitem);
SetWindowLong(hwnd_tab, GWL_EXSTYLE, GetWindowLong(hwnd_tab, GWL_EXSTYLE) | WS_EX_COMPOSITED);
hwndEdit = GetDlgItem(g_ui_window, IDC_RICHEDIT21);
hwndPaintBox = GetDlgItem(g_ui_window, IDC_PAINTBOX);
hwndGraphBox = GetDlgItem(g_ui_window, IDC_GRAPHBOX);
hwndAdvancedBox = GetDlgItem(g_ui_window, IDC_ADVANCEDBOX);
SetWindowLong(hwndPaintBox, GWL_STYLE, GetWindowLong(hwndPaintBox, GWL_STYLE) | WS_CLIPSIBLINGS);
SetWindowLong(hwndEdit, GWL_EXSTYLE, GetWindowLong(hwndEdit, GWL_EXSTYLE) &~ WS_EX_CLIENTEDGE);
// Create the status bar.
hwndStatus = CreateWindowEx(
WS_EX_COMPOSITED, STATUSCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, g_ui_window,
(HMENU)IDC_STATUSBAR, g_hinstance, NULL);
HandleWindowSizing();
UpdateTabSelection();
return true;
}
安徽网友:初始化窗口类,接受文件拖曳,创建窗口,我编不下去了
西藏网友:哈哈,笑死
福建网友:没啥意思就是初始化一个窗口
河南网友:是初始化窗口,函数名写的很明白。好久没看到Windows的代码了
福建网友:其实差不多也就那个意思
浙江网友:他真不是编的。。。。
以上信息转载自Hostloc。