Statusbar events
Posted: Sat Nov 01, 2003 3:36 am
Tested under WinXP, hope it works fine also with other WinOSses...
Code: Select all
; Example Of A Statusbar Click Event
; (c) 2003 - By FSW
;
; Tested under WinXP
; do whatever you want with it
;
#Window = 10
#StatusbarFocus = 528
#StatusBar = 1
Procedure.l LoWord (var.l)
ProcedureReturn var & $FFFF
EndProcedure
Procedure MyWindowCallback(WindowID, Message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
wParamLo = LoWord (wParam)
If Message = #StatusbarFocus
If wParamLo = 513 ;Left MouseButton
MessageRequester("Message", "Left Mouse Click In StatusBar")
ElseIf wParamLo = 516 ;Right MouseButton
MessageRequester("Message", "Right Mouse Click In StatusBar")
EndIf
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(#Window,0,0,355,180,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Statusbar Click")
CreateStatusBar(#StatusBar, WindowID())
StatusBarText(#StatusBar, 0, "Hello World!")
AddStatusBarField(270)
AddStatusBarField(80)
SetWindowCallback(@MyWindowCallback())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf