Всем привет. Вот начал учить с++ и появилась проблема, есть код: #include <iostream> #include <windows.h> #include <GdiPlus.h> #include "memory.h" #include "resource1.h" #pragma comment(lib, "gdiplus.lib") using namespace Gdiplus; using namespace std; const char* process_name = "cmd.exe"; bool is_virus = false; GdiplusStartupInput gpsui; ULONG_PTR gdiplusToken; memory* me = new memory(process_name); LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); const int Width = 420, Height = 320; void OnPaint(HDC hdc) { Graphics graphics(hdc); SolidBrush brush(Color(255, 255, 200, 100)); FontFamily fontFamily(L"IMPACT"); Font font(&fontFamily, 16, FontStyleRegular, UnitPixel); PointF pointF(5.0f, 90.0f); Bitmap* pic = Bitmap::FromResource(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDB_BITMAP1)); graphics.DrawImage(pic, 0, 0); delete[] pic; if (is_virus) { graphics.DrawString(L"Актив", -1, &font, pointF, &brush); } else { graphics.DrawString(L"Откл", -1, &font, pointF, &brush); } } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevHinstance, LPSTR lpCmdLine, int CmdShow) { HWND hwnd; MSG msg; WNDCLASS form; memset(&form, 0, sizeof(form)); form.style = 0; form.lpfnWndProc = WndProc; form.hInstance = hInstance; form.lpszClassName = "Virus"; RegisterClass(&form); hwnd = CreateWindow(form.lpszClassName, "Virus by ManyFaces", WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, Width, Height, NULL, NULL, hInstance, NULL); if (hwnd == NULL) //При удалении этого условия , убираются кнопки (Закрыть, свернуть и развернуть)! { return 0; } CreateWindow("button", "ManyFaces", WS_CHILD | WS_VISIBLE , 155, 120, 100, 30, hwnd, (HMENU)1, hInstance, NULL); // Эта кнопка есть CreateWindow(TEXT("button_2"), TEXT("ADvirus"), WS_CHILD | WS_VISIBLE, 100, 50, 100, 30, hwnd, (HMENU)2, hInstance, NULL); // Этой кнопки нету if (!GdiplusStartup(&gdiplusToken, &gpsui, NULL)) { } ShowWindow(hwnd, CmdShow); SetTimer(hwnd, 0, 100, NULL); while (GetMessage(&msg, NULL, NULL, NULL)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LONG WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; RECT rect; HDC hdcmem; HBITMAP hbimem; HANDLE hOld; switch (msg) { case WM_DESTROY: PostQuitMessage(0); break; case WM_COMMAND: switch (wParam) { case 1: MessageBox(hwnd, "Ok", "Complite", MB_OK); break; case 2: MessageBox(hwnd, "Ok", "Error", MB_OK); break; } break; case WM_TIMER: { GetClientRect(hwnd, &rect); if (me->GetProcessByName() != 0) { is_virus = true; } else { is_virus = false; } InvalidateRect(hwnd, &rect, false); } break; case WM_PAINT: { hdc = BeginPaint(hwnd, &ps); hdcmem = CreateCompatibleDC(hdc); hbimem = CreateCompatibleBitmap(hdc, Width, Height); hOld = SelectObject(hdcmem, hbimem); OnPaint(hdcmem); BitBlt(hdc, 0, 0, Width, Height, hdcmem, 0, 0, SRCCOPY); SelectObject(hdcmem, hOld); DeleteObject(hbimem); DeleteDC(hdcmem); EndPaint(hwnd, &ps); } break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } Код #include <iostream> #include <windows.h> #include <GdiPlus.h> #include "memory.h" #include "resource1.h" #pragma comment(lib, "gdiplus.lib") using namespace Gdiplus; using namespace std; const char* process_name = "cmd.exe"; bool is_virus = false; GdiplusStartupInput gpsui; ULONG_PTR gdiplusToken; memory* me = new memory(process_name); LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); const int Width = 420, Height = 320; void OnPaint(HDC hdc) { Graphics graphics(hdc); SolidBrush brush(Color(255, 255, 200, 100)); FontFamily fontFamily(L"IMPACT"); Font font(&fontFamily, 16, FontStyleRegular, UnitPixel); PointF pointF(5.0f, 90.0f); Bitmap* pic = Bitmap::FromResource(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDB_BITMAP1)); graphics.DrawImage(pic, 0, 0); delete[] pic; if (is_virus) { graphics.DrawString(L"Актив", -1, &font, pointF, &brush); } else { graphics.DrawString(L"Откл", -1, &font, pointF, &brush); } } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevHinstance, LPSTR lpCmdLine, int CmdShow) { HWND hwnd; MSG msg; WNDCLASS form; memset(&form, 0, sizeof(form)); form.style = 0; form.lpfnWndProc = WndProc; form.hInstance = hInstance; form.lpszClassName = "Virus"; RegisterClass(&form); hwnd = CreateWindow(form.lpszClassName, "Virus by ManyFaces", WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, Width, Height, NULL, NULL, hInstance, NULL); if (hwnd == NULL) //При удалении этого условия , убираются кнопки (Закрыть, свернуть и развернуть)! { return 0; } CreateWindow("button", "ManyFaces", WS_CHILD | WS_VISIBLE , 155, 120, 100, 30, hwnd, (HMENU)1, hInstance, NULL); // Эта кнопка есть CreateWindow(TEXT("button_2"), TEXT("ADvirus"), WS_CHILD | WS_VISIBLE, 100, 50, 100, 30, hwnd, (HMENU)2, hInstance, NULL); // Этой кнопки нету if (!GdiplusStartup(&gdiplusToken, &gpsui, NULL)) { } ShowWindow(hwnd, CmdShow); SetTimer(hwnd, 0, 100, NULL); while (GetMessage(&msg, NULL, NULL, NULL)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LONG WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; RECT rect; HDC hdcmem; HBITMAP hbimem; HANDLE hOld; switch (msg) { case WM_DESTROY: PostQuitMessage(0); break; case WM_COMMAND: switch (wParam) { case 1: MessageBox(hwnd, "Ok", "Complite", MB_OK); break; case 2: MessageBox(hwnd, "Ok", "Error", MB_OK); break; } break; case WM_TIMER: { GetClientRect(hwnd, &rect); if (me->GetProcessByName() != 0) { is_virus = true; } else { is_virus = false; } InvalidateRect(hwnd, &rect, false); } break; case WM_PAINT: { hdc = BeginPaint(hwnd, &ps); hdcmem = CreateCompatibleDC(hdc); hbimem = CreateCompatibleBitmap(hdc, Width, Height); hOld = SelectObject(hdcmem, hbimem); OnPaint(hdcmem); BitBlt(hdc, 0, 0, Width, Height, hdcmem, 0, 0, SRCCOPY); SelectObject(hdcmem, hOld); DeleteObject(hbimem); DeleteDC(hdcmem); EndPaint(hwnd, &ps); } break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } Сделал форму, добавил на неё текст и кнопку, хочу добавить ещё кнопки, делаю всё тем же путём, но они не добавляются. Как была одна кнопка так и осталась. Искал в инете , не нашёл.