elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  ASM (Moderador: Eternal Idol)
| | | |-+  Creacion de controles Personalizados? (ASM 32 Bits)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Creacion de controles Personalizados? (ASM 32 Bits)  (Leído 4,065 veces)
Riki_89D


Desconectado Desconectado

Mensajes: 851


BCN CITY


Ver Perfil
Creacion de controles Personalizados? (ASM 32 Bits)
« en: 25 Diciembre 2009, 19:55 pm »

Es posible crear por ejemplo un boton distino a los estandares dw Windows,por ejemplo un boton de forma triangular?? oseacrear un control personalizado,programo con Ensamblador de 32 bits (utilizo las API de windows) como puedo crear mis propios controles?


:S

salu2


En línea

Eternal Idol
Kernel coder
Moderador
***
Desconectado Desconectado

Mensajes: 5.937


Israel nunca torturó niños, ni lo volverá a hacer.


Ver Perfil WWW
Re: Creacion de controles Personalizados? (ASM 32 Bits)
« Respuesta #1 en: 25 Diciembre 2009, 20:15 pm »

Si, owner drawn, de la MSDN (no lo encuentre on-line  :():

Using Owner Drawn Buttons
The parent window of an owner-drawn button typically responds to at least three messages for the button:

WM_INITDIALOG
WM_COMMAND
WM_DRAWITEM
When you must paint an owner-drawn button, the system sends the parent window a WM_DRAWITEM message whose lParam parameter is a pointer to a DRAWITEMSTRUCT structure. Use this structure with all owner-drawn controls to provide the application with the information it requires to paint the control. The itemAction and itemState members of the DRAWITEMSTRUCT structure define how to paint an owner-drawn button.

The following example shows how to process WM_INITDIALOG, WM_DRAWITEM, and WM_COMMAND messages for owner-drawn buttons. This example demonstrates how to draw one of two bitmaps for a control, depending on whether the control is selected. You would typically use the wParam parameter of the WM_DRAWITEM message to identify the control; in this example, only one control is assumed.

Código
  1. BOOL CALLBACK OwnDrawProc(HWND hDlg, UINT message, WPARAM wParam,
  2.                          LPARAM lParam)
  3. {
  4.    HDC hdcMem;
  5.    LPDRAWITEMSTRUCT lpdis;
  6.  
  7.    switch (message)
  8.    {
  9.        case WM_INITDIALOG:
  10.  
  11.            // hinst, hbm1 and hbm2 are defined globally.
  12.            hbm1 = LoadBitmap((HANDLE) hinst, "OwnBit1");
  13.            hbm2 = LoadBitmap((HANDLE) hinst, "OwnBit2");
  14.            return TRUE;
  15.  
  16.        case WM_DRAWITEM:
  17.            lpdis = (LPDRAWITEMSTRUCT) lParam;
  18.            hdcMem = CreateCompatibleDC(lpdis->hDC);
  19.  
  20.            if (lpdis->itemState & ODS_SELECTED)  // if selected
  21.                SelectObject(hdcMem, hbm2);
  22.            else
  23.                SelectObject(hdcMem, hbm1);
  24.  
  25.            // Destination
  26.            StretchBlt(
  27.                lpdis->hDC,         // destination DC
  28.                lpdis->rcItem.left, // x upper left
  29.                lpdis->rcItem.top,  // y upper left
  30.  
  31.                // The next two lines specify the width and
  32.                // height.
  33.                lpdis->rcItem.right - lpdis->rcItem.left,
  34.                lpdis->rcItem.bottom - lpdis->rcItem.top,
  35.                hdcMem,    // source device context
  36.                0, 0,      // x and y upper left
  37.                32,        // source bitmap width
  38.                32,        // source bitmap height
  39.                SRCCOPY);  // raster operation
  40.  
  41.            DeleteDC(hdcMem);
  42.            return TRUE;
  43.  
  44.        case WM_COMMAND:
  45.            if (wParam == IDOK
  46.                || wParam == IDCANCEL)
  47.            {
  48.                EndDialog(hDlg, TRUE);
  49.                return TRUE;
  50.            }
  51.            if (HIWORD(wParam) == BN_CLICKED)
  52.            {
  53.                switch (LOWORD(wParam))
  54.                {
  55.                    case IDC_OWNERDRAW:
  56.  
  57.                        // application-defined processing
  58.  
  59.                        break;
  60.                }
  61.            }
  62.            break;
  63.  
  64.        case WM_DESTROY:
  65.            DeleteObject(hbm1);  // delete bitmaps
  66.            DeleteObject(hbm2);
  67.  
  68.            break;
  69.  
  70.    }
  71.    return FALSE;
  72.        UNREFERENCED_PARAMETER(lParam);
  73. }


« Última modificación: 25 Diciembre 2009, 20:18 pm por Eternal Idol » En línea

La economía nunca ha sido libre: o la controla el Estado en beneficio del Pueblo o lo hacen los grandes consorcios en perjuicio de éste.
Juan Domingo Perón
Debci
Wiki

Desconectado Desconectado

Mensajes: 2.021


Actualizate o muere!


Ver Perfil WWW
Re: Creacion de controles Personalizados? (ASM 32 Bits)
« Respuesta #2 en: 27 Diciembre 2009, 21:02 pm »

eso es asm? parece C++ xD
O quizas parece mi in-experiencia.

Saludos
En línea

Eternal Idol
Kernel coder
Moderador
***
Desconectado Desconectado

Mensajes: 5.937


Israel nunca torturó niños, ni lo volverá a hacer.


Ver Perfil WWW
Re: Creacion de controles Personalizados? (ASM 32 Bits)
« Respuesta #3 en: 27 Diciembre 2009, 21:57 pm »

eso es asm? parece C++ xD
O quizas parece mi in-experiencia.

Es C ... ya podrias haber puesto algun ejemplo del tema en assembly  :rolleyes:
En línea

La economía nunca ha sido libre: o la controla el Estado en beneficio del Pueblo o lo hacen los grandes consorcios en perjuicio de éste.
Juan Domingo Perón
Debci
Wiki

Desconectado Desconectado

Mensajes: 2.021


Actualizate o muere!


Ver Perfil WWW
Re: Creacion de controles Personalizados? (ASM 32 Bits)
« Respuesta #4 en: 27 Diciembre 2009, 22:33 pm »

eso es asm? parece C++ xD
O quizas parece mi in-experiencia.

Es C ... ya podrias haber puesto algun ejemplo del tema en assembly  :rolleyes:
No pillo la ironia pero weno xDDD

Saludos
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Diccionarios personalizados
Hacking
Gauch0 2 651 Último mensaje 11 Abril 2024, 18:06 pm
por Gauch0
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines