Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Enlever le son d'une MessageBox

2 réponses
Avatar
Mamelook
Bonjour,
Je voudrai enlever le son d'une message box (MB_ICONASTERISK) car
j'aimerai utiliser mes propres son grace a un PlaySound. Existe t-il un
tag ou une solution alternative ?

Amicalement Christophe

2 réponses

Avatar
Christian ASTOR
Mamelook wrote:

Je voudrai enlever le son d'une message box (MB_ICONASTERISK) car
j'aimerai utiliser mes propres son grace a un PlaySound. Existe t-il un
tag ou une solution alternative ?



MessageBoxIndirect()
Pour MB_ICONASTERISK,
dwStyle = MB_USERICON | ... ;
hInstance = NULL;
lpszIcon = IDI_ASTERISK;
Avatar
Mamelook
Merci beaucoup, c'est exactement ce que je voulais !

Voici un code exploitable :

/*MessageBox informative sans son*/
void msgbox_nfo(char * titre, char * messa)
{
MSGBOXPARAMS MsgParam;
MsgParam.cbSize = sizeof(MSGBOXPARAMS);
MsgParam.dwStyle = MB_USERICON|MB_OK;
MsgParam.hInstance = NULL;
MsgParam.hwndOwner = NULL;
MsgParam.lpszIcon = IDI_ASTERISK;
MsgParam.lpszCaption = titre;
MsgParam.lpszText = messa;
MessageBoxIndirect(&MsgParam);
}

Le Thu, 01 May 2008 17:19:40 +0200, Christian ASTOR
a écrit:

Mamelook wrote:

Je voudrai enlever le son d'une message box (MB_ICONASTERISK) car
j'aimerai utiliser mes propres son grace a un PlaySound. Existe t-il
un tag ou une solution alternative ?



MessageBoxIndirect()
Pour MB_ICONASTERISK,
dwStyle = MB_USERICON | ... ;
hInstance = NULL;
lpszIcon = IDI_ASTERISK;