*   >> Lectura Educación Artículos >> science >> programación

Tipos de botón en Windows

Los controles de Windows predefinidos - Parte 8 de volumen - Interfaz de usuario de Windows Introducción Esto es parte de mi serie 8, Controles de Windows predefinidas. Para entender este tutorial, la mayoría ha leído todos los tutoriales anteriores de la serie. En esta parte de la serie, nos fijamos en los tipos de botones en las ventanas. Nota: Si no puede ver el código o si cree que falta algo (enlace roto, la imagen ausente), simplemente en contacto conmigo en [email protected].

Es decir, en contacto conmigo para el más mínimo problema que tenga acerca de lo que está leyendo. Botón botón A es un control que el usuario puede hacer clic para proporcionar información a una aplicación. Hoy en día las ventanas UI API cuenta con ocho botones. Vamos a ver el significado de los ocho botones en este tutorial. Push Button Un botón de comando es el botón rectangular habitual.

Pruebe el siguiente código para ver lo que un botón se ve así: #include using namespace std; LRESULT CALLBACK MainWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, lParam LPARAM) {switch (uMsg) {default: regresan DefWindowProc (hwnd, uMsg, wParam, lParam); } Return 0; } Int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {WCX WNDCLASSEX; wcx.cbSize = sizeof (WCX); wcx.style = CS_HREDRAW | CS_VREDRAW; wcx.lpfnWndProc = MainWndProc; wcx.cbClsExtra = 0; wcx.cbWndExtra = 0; wcx.hInstance = hInstance; wcx.hIcon = NULL; wcx.

hCursor = LoadCursor (NULL, IDC_ARROW); wcx.hbrBackground = (HBRUSH) (COLOR_BACKGROUND + 1); wcx.lpszMenuName = NULL; wcx.lpszClassName = "MainWClass"; wcx.hIconSm = NULL; RegisterClassEx (y WCX); HWND hwndMain; hwndMain = CreateWindowEx (0, "MainWClass", "Ventana principal", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); si (hwndMain!) return false; ShowWindow (hwndMain, SW_SHOW); UpdateWindow (hwndMain); HWND hwndPush; hwndEdit1 = CreateWindowEx (0, "BOTÓN", "Push Button", WS_CHILD | BS_PUSHBUTTON, 100, 100, 90, 25, hwndMain, (HMENU) 1, hInstance, NULL); ShowWindow (hwndPush, SW_SHOW); UpdateWindow (hwndPush); Msg MSG; BOOL Bret; while ((Bret = GetMessage (y msg, hwndMain, 0, 0)) = 0!) {if (Bret == -1) {//manejar el error y posiblemente salir de la aplicación} else {TranslateMessage (y msg); DispatchMessage (y msg); }} Return msg.

wParam; } Puede utilizar el siguiente comando en el símbolo del sistema para compilar el código: g ++ winpush.cpp -mwindows -o winpush.

Page   <<       [1] [2] [3] [4] >>
Copyright © 2008 - 2016 Lectura Educación Artículos,https://lectura.nmjjxx.com All rights reserved.