Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.


speakerphone


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2008, 12:36 PM
Junior Member
 
Join Date: Feb 2008
Posts: 17
Default speakerphone

Hello all,

Does anyone know of a way to toggle the speakerphone on and off?
I have gone through the registry but can't find anything that looks appropriate.
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 03:04 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,955
Default

Sending the keycode 127 toggles the speakerphone (while speaking). Credits go to Peter Foot's blog: http://peterfoot.net/Programmaticall...akerphone.aspx

If you want to answer a call and automatically activate the speaker you should download this example: Answering and dropping a call from code
And change two of the subs:
Code:
Sub phone_IncomingCall
    timer1.Enabled = true 'Wait two seconds before pressing the Talk button.
End Sub

Sub Timer1_Tick
    If duringCall Then
        timer1.Enabled = false
        hw.KeyPress(127) 'Toggle the speaker.
    Else
        hw.KeyPress(114) 'Simulate the green Talk button.
        duringCall = true
    End If
End Sub
Otherwise you could just use Hardware.KeyPress(127) with a hardware object.
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 04:16 PM
Junior Member
 
Join Date: Feb 2008
Posts: 17
Default

Thanks Erel!

It's odd that there is no (proper) way to do this in code, but a great testament to Peter Foot's ingenuity for providing a decent workaround.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:42 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0