Kod:
#include<windows.h>
#include<string>
#include<iostream>
using namespace std;
HWND okno;
HWND tekst;
string napis="aaa";
LRESULT CALLBACK procedura(HWND hwnd,UINT message,WPARAM wpar,LPARAM lpar);
int WINAPI WinMain(
HINSTANCE program,
HINSTANCE oj,
LPSTR lpsCmdLine,
int nMode)
{
WNDCLASS klasa;
MSG wiadomosc;
klasa.hInstance=program;
klasa.lpszClassName="klasa";
klasa.lpfnWndProc=procedura;
klasa.lpszMenuName=NULL;
klasa.style=0;
klasa.hIcon=LoadIcon(NULL,IDI_WINLOGO);
klasa.hCursor=LoadCursor(NULL,IDC_ARROW);
klasa.hbrBackground=(HBRUSH) GetStockObject(BLACK_BRUSH);
klasa.cbClsExtra=0;
klasa.cbWndExtra=0;
if(!RegisterClass(&klasa)) return 1;
okno=CreateWindow("klasa","KeyGen (c) Coded by Iron0088 ",WS_OVERLAPPEDWINDOW,300,300,420,300,NULL,NULL,program,NULL);
ShowWindow(okno,SW_SHOW);
char napisek[222];
strcpy(napisek,napis.c_str());
tekst=CreateWindowEx(0,"EDIT",napisek,WS_CHILD | WS_VISIBLE | WS_BORDER,10,
150,400,20,okno,NULL,program,NULL);
CreateWindow("BUTTON","Generate",WS_CHILD|WS_VISIBLE,150,200,150,30,okno,(HMENU)100,program,NULL);
while(GetMessage(&wiadomosc,NULL,0,0))
{
ShowWindow(tekst,SW_SHOW);
DispatchMessage(&wiadomosc);
TranslateMessage(&wiadomosc);
}
}
LRESULT CALLBACK procedura(
HWND hwnd,
UINT message,
WPARAM wpar,
LPARAM lpar)
{
switch(message)
{
case WM_COMMAND:
switch(LOWORD(wpar))
{
case 100:
napis="bbb";
break;
}
break;
default:
return DefWindowProc(hwnd,message,wpar,lpar);
}
}