MessageRequester #MB_ICON
Posted: Mon Aug 13, 2012 9:23 am
Is there a way to impose your own images instead of the system's images? (#MB_ICONWARNING etc)
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
#MB_USERICON = $080
mb.MSGBOXPARAMS
mb\cbSize = SizeOf(mb)
mb\hwndOwner = 0
mb\hInstance = GetModuleHandle_ (0)
mb\lpszText = @"Test MBox"
mb\lpszCaption = @"Message Title"
mb\dwStyle = #MB_YESNOCANCEL|#MB_USERICON
mb\lpszIcon = 1
mb\dwContextHelpId = 0
mb\lpfnMsgBoxCallback = 0
mb\dwLanguageId = 0
If OpenWindow(0, 0, 0, 400, 300, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
MessageBoxIndirect_(mb) ;
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
EndIf
End
do you know if you can use an image included (includebinary) in the code?RASHAD wrote:You can use any of the program icons (in the compiler options)
Code: Select all
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.00".
// #include <windows.h>
// #include <commctrl.h>
// #include <richedit.h>
// LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
8001 ICON "G:\Projects\Icon\ActVista.ico"
8002 ICON "G:\Projects\Icon\CdPlayer.ico"
Code: Select all
#MB_USERICON = $080
Global mb.MSGBOXPARAMS
mb\cbSize = SizeOf(mb)
mb\hwndOwner = 0
mb\hInstance = GetModuleHandle_ (0)
mb\lpszText = @"Test MBox"
mb\lpszCaption = @"Message Title"
mb\dwStyle = #MB_YESNOCANCEL|#MB_USERICON
mb\dwContextHelpId = 0
mb\lpfnMsgBoxCallback = 0
mb\dwLanguageId = 0
If OpenWindow(0, 0, 0, 400, 300, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
mb\lpszIcon = 8001
MessageBoxIndirect_(mb)
Delay(100)
mb\lpszIcon = 8002
MessageBoxIndirect_(mb) ;
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
EndIf
End
