MessageRequester #MB_ICON
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
MessageRequester #MB_ICON
Is there a way to impose your own images instead of the system's images? (#MB_ICONWARNING etc)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: MessageRequester #MB_ICON
Hi
You can use any of the program icons (in the compiler options)
Or the dialogue icon by itself
You can use any of the program icons (in the compiler options)
Or the dialogue icon by itself
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
Egypt my love
Re: MessageRequester #MB_ICON
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)
Re: MessageRequester #MB_ICON
- Add as many icons as you can to the next script
- Remember to increase the ID 8001,8002,8003 and so on
- Save the file as "Icons.rc"
- Add the file to the resources in the compiler options
- Change the Req ID as you like (mb\lpszIcon = 8001)
Have fun
For TEST
- Remember to increase the ID 8001,8002,8003 and so on
- Save the file as "Icons.rc"
- Add the file to the resources in the compiler options
- Change the Req ID as you like (mb\lpszIcon = 8001)
Have fun
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"
For TEST
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
Egypt my love
Re: MessageRequester #MB_ICON
Thank you Rashad! I keep forgetting about the resource-ability... I was so focused on "DataSection/INcludeBinary"...
Sadly; when I run (with valid icons set in the rc file)

I recall there being "something" (I've used resources in pb previously) but it's late here and i'm drawing a blank.
but that is good stuff. THanks again!
Sadly; when I run (with valid icons set in the rc file)

I recall there being "something" (I've used resources in pb previously) but it's late here and i'm drawing a blank.
but that is good stuff. THanks again!
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: MessageRequester #MB_ICON
ooh that's a lovely solution Rashad 
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.

