Ver Mensaje Individual
  #4  
Antiguo 15-07-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por Johnny Q
los valores que puede tomar LPARAM: 0, 1 ó -1.
No.

Hagamos algunas aclaraciones.

Los mensajes WM_XXX, realmente no son parte de la VCL, sino que forman parte del sistema de mensajes del sistema operativo.Windows se comunica con las ventanas enviando estos mensajes y cada ventana reacciona según sus necesidades.

La VCL traduce este sistema de mensajes en un sistema de eventos (OnKeyDown por ejemplo) pero deja abierta la posibilidad de acceder directamente al envío de mensajes de Windows con métodos como Perform.

Los parámetros de Perform corresponden a los parámetros de la función SendMessage de la API de Windows y sus nombres clásicos son WParam y LParam. La W y la L vienen de Word y Long, refiriéndose a los tipos de datos (Word un enterode 16 bits y Long un entero de 32 bits) aunque esto quedó para la historia ya que actualmente ambos son enteros de 32 bits.

Los valores de WParam y LParam, tal como indica Lepe, dependen del mensaje en específico y pueden ser muy variados. En ocasiones representan en realidad punteros a estructuras de datos con más información.

En el caso específico de WM_KEYDOWN, el valor de los parámetros, según el SDK de Windows es:

Cita:
wParam
Specifies the virtual-key code of the nonsystem key

lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.

0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.

16-23
Specifies the scan code. The value depends on the OEM.

24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.

25-28
Reserved; do not use.

29
Specifies the context code. The value is always 0 for a WM_KEYDOWN message.

30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.

31
Specifies the transition state. The value is always zero for a WM_KEYDOWN message.
En el SDK de Windows puedes ver los valores posibles para cada mensaje WM_XXX.

// Saludos
Responder Con Cita