Message Requester beep

Just starting out? Need help? Post your questions and find answers here.
Marvi
User
User
Posts: 17
Joined: Fri Oct 03, 2008 6:02 pm
Location: Milano

Message Requester beep

Post by Marvi »

There is any way to eliminate the noisy beep that sounds when Message Requester window appears?

I tried the code

SystemParametersInfo_(#SPI_SETBEEP,0,0,0)

but it doesn't work (My OS is Vista)

Thanks in advance
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Post by akj »

Just add a flag of $80, thus:

Code: Select all

MessageRequester("Confirm", "Are you sure?", #PB_MessageRequester_YesNo | $80)
Anthony Jordan
Marvi
User
User
Posts: 17
Joined: Fri Oct 03, 2008 6:02 pm
Location: Milano

Post by Marvi »

Thanks, but it doesn't work! The beep remains.....
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

on XP it works.

that means on Vista (64?) it is another Flag but it should exist.

this is one of the reasons, why it is less useful to memorize some |$80 instead of the name of the bloody constant... ;)
oh... and have a nice day.
Marvi
User
User
Posts: 17
Joined: Fri Oct 03, 2008 6:02 pm
Location: Milano

Post by Marvi »

My operative system is Vista 32.

This beep is really annoying........ Anyone else has a good idea?
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Post by Arctic Fox »

No beep here with akj's example (also Vista 32-bit) :?
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Marvi
User
User
Posts: 17
Joined: Fri Oct 03, 2008 6:02 pm
Location: Milano

Post by Marvi »

Ok it works now! Maybe I wrote something wrong......

THANKSSSSSS TO EVERYBODY
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Post by akj »

I think the constant $80 has the name #MB_USERICON but I am uncertain as this name is not recognised by the PB compiler.
Anthony Jordan
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Post by +18 »

oh, please convert this code for PB

Code: Select all

Function MsgBox2( ByVal sText As String, ByVal dwStyle As Dword, ByVal sTitle As String ) As Long 
 
    Local MB As MSGBOXPARAMS 
 
    MB.cbSize = SizeOf( MSGBOXPARAMS ) 
    MB.lpszText = StrPtr( sText ) 
    MB.lpszCaption = StrPtr( sTitle ) 
     
    If ( dwStyle And %MB_ICONEXCLAMATION ) Then 
   MB.lpszIcon = %IDI_EXCLAMATION 
   dwStyle = dwStyle And Not %MB_ICONEXCLAMATION 
    ElseIf ( dwStyle And %MB_ICONINFORMATION ) Then 
   MB.lpszIcon = %IDI_ASTERISK 
   dwStyle = dwStyle And Not %MB_ICONINFORMATION    
    ElseIf ( dwStyle And %MB_ICONQUESTION ) Then 
   MB.lpszIcon = %IDI_QUESTION 
   dwStyle = dwStyle And Not %MB_ICONQUESTION 
    ElseIf ( dwStyle And %MB_ICONSTOP ) Then 
   MB.lpszIcon = %IDI_HAND 
   dwStyle = dwStyle And Not %MB_ICONSTOP    
    End If 
 
    MB.dwStyle = dwStyle Or %MB_TASKMODAL Or %MB_USERICON 
 
    Function = MessageBoxIndirect( MB ) 
     
End Function
merci
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Re: Message Requester beep

Post by +18 »

Thanks, that's good :D
Post Reply