EventwParam()

Syntaxe

Resultat = EventwParam()
Description
Renvoie le paramètre WPARAM du dernier évènement.

Arguments

Aucun.

Valeur de retour

Renvoie le paramètre WPARAM du dernier évènement.

Remarques

Cette fonction n'est plus supportée et ne devrait plus être utilisée. Utilisez plutôt la fonction SetWindowCallback() afin d'avoir un plein accès aux messages Windows.

Exemple: Sans callback

  OpenWindow(0, 0, 0, 300, 200, "Messages", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
   
  Repeat
    Event = WaitWindowEvent()
    Debug "-> Evènement n°"+Str(Event)+" : WParam="+Str(EventwParam())+" , LParam="+Str(EventlParam())
    Select Event
      Case #PB_Event_CloseWindow
        End
    EndSelect
  ForEver 

Exemple: Avec callback

  Procedure WinCallback(hWnd, uMsg, wParam, lParam)
    Debug "Evènement n°"+Str(uMsg)+" : WParam="+Str(wParam)+" , LParam="+Str(lParam)
    ProcedureReturn #PB_ProcessPureBasicEvents
  EndProcedure

  OpenWindow(0, 0, 0, 300, 200, "Messages", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)

  SetWindowCallback(@WinCallback())
  
  Repeat
    Event = WaitWindowEvent()
    ;Debug "-> Evènement n°"+Str(Event)+" : WParam="+Str(EventwParam())+" , LParam="+Str(EventlParam())
    Select Event
      Case #PB_Event_CloseWindow
        End
    EndSelect
  ForEver  

Exemple

  ; Appuyer sur une combinaison de plusieurs touches : CTRL, MAJ, Bouton souris, puis cliquez gauche
  OpenWindow(0, 0, 0, 300, 200, "Messages", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)

  TextGadget(0,4,4,392,92,"Clic")

  Repeat
  event = WaitWindowEvent()
  
  Select event
    Case #WM_LBUTTONDOWN
      x = EventlParam() & $FFFF   ; Mot de poids faible(16 Bits)
      y = EventlParam()>>16       ; Mot de poids fort  (16 Bits)
      cles = EventwParam()            
      
      SetGadgetText(0,"X= " + Str(x) + "  Y= " + Str(y) + Chr(13) + Chr(10) + "Clés: " + RSet(Bin(cles),32,"0"))
      
      combinaison$ = ""
      If cles & #MK_CONTROL
        combinaison$ = combinaison$ + " CTRL "
      EndIf
      If cles & #MK_SHIFT
        combinaison$ = combinaison$ + " MAJ "
      EndIf
      If cles & #MK_MBUTTON 
        combinaison$ = combinaison$ + " Clic milieu "
      EndIf
      If cles & #MK_RBUTTON
        combinaison$ = combinaison$ + " Clic droit "
      EndIf
      If cles & #MK_LBUTTON
        combinaison$ = combinaison$ + " Clic gauche "
      EndIf
      
      Debug  combinaison$
      
  EndSelect
  Until event = #PB_Event_CloseWindow

Voir aussi

EventlParam()

OS Supportés

Windows

<- EventlParam() - Window Index - GetActiveWindow() ->