#include <iostream>
#include <windows.h>
#include <tchar.h>
#include <stdlib.h>
#include <string.h>
#define ID_BUTTON 1
static TCHAR szWindowClass[]=_T("Desctop App");
static TCHAR szTitle[]=_T("Êðèê î ïîìîùè");
int t =0;
HINSTANCE hInst;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int voron(int x);
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow) {
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, IDI_APPLICATION);
if (!RegisterClassEx(&wcex)) {
MessageBox(NULL,
_T("Call to RegisterClassEx failled"),
_T("Window Desktop Guided Tour"),
NULL);
return 1;
}
hInst=hInstance;
HWND hWnd = CreateWindow(
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
400, 300,
NULL,
NULL,
hInstance,
NULL
);
if(!hWnd) {
MessageBox(NULL,
_T("Call to RegisterClassEx failled"),
_T("Window Desktop Guided Tour"),
NULL);
return 1;
}
ShowWindow(hWnd,
nCmdShow);
UpdateWindow(hWnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
}
int q=0;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
char i[10];
wsprintf(i, "%d", q);
switch (message) {
case WM_CREATE:
CreateWindow("button", "òðóäíà",
WS_VISIBLE | WS_CHILD,
120, 170, 100, 25,
hWnd,(HMENU)ID_BUTTON, NULL, NULL);
CreateWindow("static", i,
WS_VISIBLE | WS_CHILD | WS_BORDER,
5, 5, 370, 50,
hWnd, NULL, NULL, NULL);
break;
case WM_COMMAND:
if(LOWORD(wParam==ID_BUTTON)){
q++;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
#include <iostream>
#include <windows.h>
#include <tchar.h>
#include <stdlib.h>
#include <string.h>
#define ID_BUTTON 1
static TCHAR szWindowClass[]=_T("Desctop App");
static TCHAR szTitle[]=_T("Êðèê î ïîìîùè");
int t =0;
HINSTANCE hInst;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int voron(int x);
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow) {
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, IDI_APPLICATION);
if (!RegisterClassEx(&wcex)) {
MessageBox(NULL,
_T("Call to RegisterClassEx failled"),
_T("Window Desktop Guided Tour"),
NULL);
return 1;
}
hInst=hInstance;
HWND hWnd = CreateWindow(
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
400, 300,
NULL,
NULL,
hInstance,
NULL
);
if(!hWnd) {
MessageBox(NULL,
_T("Call to RegisterClassEx failled"),
_T("Window Desktop Guided Tour"),
NULL);
return 1;
}
ShowWindow(hWnd,
nCmdShow);
UpdateWindow(hWnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
}
int q;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
char i[10];
int q =0;
wsprintf(i, "%d", q);
switch (message) {
case WM_CREATE:
CreateWindow("button", "òðóäíà",
WS_VISIBLE | WS_CHILD,
120, 170, 100, 25,
hWnd,(HMENU)ID_BUTTON, NULL, NULL);
CreateWindow("static", i,
WS_VISIBLE | WS_CHILD | WS_BORDER,
5, 5, 370, 50,
hWnd, NULL, NULL, NULL);
break;
case WM_COMMAND:
if(LOWORD(wParam==ID_BUTTON)){
q++;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
int voron(int x){
x++;
return x;
}<b></b>