http://msdn.microsoft.com/en-us/library ... 85%29.aspx
which lets you add a 4th button, a context sensitive (through a id you optionally can pass) Help button.
Would be really cool to see a PureBasic's own MessageRequestere extended to provide a similar feature, however I hope you enjoy this code anyway.
Code: Select all
EnableExplicit
#MB_HELP=$00004000
#MB_DEFBUTTON4=$00000300
Procedure.l MessageRequesterIndirect_Callback(*lpHelpInfo.HELPINFO)
MessageRequester("Help","Help Text")
;the HELPINFO struct lets you do more advanced stuff here,
;like serving help for multiple requesters, use mbox\dwContextHelpId to pass along a help id.
;See http://msdn.microsoft.com/en-us/library/ms645511%29VS.85%29.aspx for more
EndProcedure
Procedure.l MessageRequesterIndirect(title$,message$,flags.l=#Null,parent.i=#Null)
Protected result.l,mbox.MSGBOXPARAMS
mbox\cbsize=SizeOf(MSGBOXPARAMS)
mbox\hwndOwner=WindowID(parent)
mbox\hInstance=#Null
mbox\lpszText=@message$
mbox\lpszCaption=@title$
mbox\dwStyle=#MB_SETFOREGROUND|#MB_TOPMOST|#MB_APPLMODAL|flags
mbox\lpszIcon=#Null
mbox\dwContextHelpId=#Null
mbox\lpfnMsgBoxCallback=@MessageRequesterIndirect_Callback()
mbox\dwLanguageId=#Null
result=MessageBoxIndirect_(mbox)
ProcedureReturn result
EndProcedure
#Window_Main=1
Define event.l,quit.l
If OpenWindow(#Window_Main,100,200,195,260,"PureBasic Window",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
Debug MessageRequesterIndirect("Title","Message",#MB_ABORTRETRYIGNORE|#MB_HELP|#MB_DEFBUTTON4|#MB_ICONQUESTION,#Window_Main)
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
quit=#True
EndSelect
Until quit
EndIf
End