Test Foro de elhacker.net SMF 2.1

Programación => Programación C/C++ => Mensaje iniciado por: raxor12 en 20 Febrero 2015, 05:11 AM

Título: duda con WinAPI para imprimir algo
Publicado por: raxor12 en 20 Febrero 2015, 05:11 AM
Buenas me gustaria que me ayudaran a entender esto

Código (cpp) [Seleccionar]
#define button1 1

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{


   switch (message)                  /* handle the messages */
   {
 case WM_CREATE:{ CreateWindow(TEXT("button"),
          TEXT("Button1"),WS_VISIBLE | WS_CHILD,
         HMENU) button1,NULL,NULL);
                                                                                                                         
                               
                     
                        break;


       }

case WM_COMMAND:{

           if(LOWORD(wParam) == button1){

                       PAINTSTRUCT ps;
                       HDC hdc = BeginPaint(hwnd,&ps);
                       TextOut(hdc,120,10,"Hola mundo ventana",20);
                       Beep(200,200)
                       EndPaint(hwnd,&ps);

           }

           break;

       }
}



Me gustaria que cuando yo aprete un boton se imprimiera el "hola mundo ventana" y no entiendo porque no lo hace, se agredece de antemano a quien me aclare la duda :)!!!

Mod: Mensaje modificado, al publicar código usa etiquetas GeSHi