|
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports Microsoft.WindowsMobile
Imports Microsoft.WindowsMobile.Status
Imports Microsoft.WindowsMobile.PocketOutlook
Imports System.Runtime.InteropServices
Public Class Form1
Private StateNotificationList As New ArrayList()
Const KEYEVENTF_KEYUP = &H2
Const KEYEVENTF_KEYDOWN = &H0
<DllImport("coredll.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _
Private Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
End Sub
Public Shared Sub BounceCall()
keybd_event(115, 0, KEYEVENTF_KEYDOWN, 0)
keybd_event(115, 0, KEYEVENTF_KEYUP, 0)
End Sub
Private Sub ChangeOccurred(ByVal sender As Object, ByVal args As ChangeEventArgs)
If SystemState.PhoneIncomingCall = True And chkIgnoreAllCalls.Checked = True Then
BounceCall()
End If
If SystemState.PhoneIncomingCall = True And SystemState.PhoneIncomingCallerNumber = txtIgnoreThisNumber.Text Then
BounceCall()
End If
End Sub
Private Sub MonitorNotifications()
Dim s As SystemState
s = New SystemState(SystemProperty.PhoneIncomingCall)
AddHandler s.Changed, AddressOf ChangeOccurred
StateNotificationList.Add(s)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MonitorNotifications()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
BrainThump is my outlet for "fun projects" outside of what I do for a living. It started in 2004 when I first developed a .NET Compact Framework application for a U.S. Navy customer and I decided I really liked it so started doing it for fun after work.
By day I work as a software engineer for a defense/government contractor developing solutions for customers like the U.S. Navy and the FAA. By night I like to develop software for Windows Mobile devices.
I'm also heavily involved with the .NET/Geek community. I love Code Camps, user groups, and the interaction with the whole community. For my efforts in supporting the community I've been recognized as a Microsoft MVP(Device Application Development), an INETA Community Champion, and inducted to the Community-Credit.com Hall of Fame.