finestra edit button

Ecco alcuni "spezzoni" di codice di questo programma windows, con finestra, controllo EDIT e BUTTON.
LRESULT CALLBACK ProceduraWindows(HWND oggettofinestra, UINT messaggiowindows, WPARAM wParam, LPARAM lParam)
{
switch (messaggiowindows) /* handle the messaggi */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the messaggio queue */
break;
case WM_COMMAND:
if (wParam == BN_CLICKED) {GetWindowText(textboxfinestra, buff, 100);MessageBox(finestra, buff, "Evento", MB_OK);};
break;
case WM_KEYDOWN:
switch (wParam)
{
case VK_LEFT:
x = x - 5;
frase = "Sinistra\0";
DestroyWindow(textboxfinestra);
textboxfinestra = CreateWindow("EDIT", frase,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL ,
10,10,200,20,
finestra,
NULL,
istanzaquestoprogramma,
NULL);
..........
finestra = CreateWindowEx(
0, /* Extended possibilites for variation */
nomeclasse, /* Classname */
captionfinestra, /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
x, /* Windows decides the position */
y, /* where the window ends up on the screen */
larghezza, /* The programs width */
altezza, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
istanzaquestoprogramma, /* Program Instance handler */
NULL /* No Window Creation data */
);
textboxfinestra = CreateWindow("Edit", frase, // "ComboBox"
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL ,
10,10,200,20,
finestra,
NULL,
istanzaquestoprogramma,
NULL);
bottone = CreateWindow("BUTTON", "clicca\0",
WS_CHILD | WS_VISIBLE,
100,100,200,20,
finestra,
NULL,
istanzaquestoprogramma,
NULL);

Пікірлер