OpenNETCF NotifyIcon.Click event doesn't fire

G

Guest

I'm got a program that I'm working on where I'm using the OpenNETCF
NotifyIcon class to get an icon on the Today screen status bar. The icon
comes up just fine, but I've got a Click event handler that works fine in the
emulator but not on a real device (Audiovox PPC6601 running WM2003SE). On the
real device, the Click event never fires.

Here's some code:
Imports System.Threading
Imports OpenNETCF.Windows.Forms
Public Module Startup
Friend WithEvents notifyIcon As NotifyIcon

Public Sub Main()

'Display splash screen
Dim form As New splashform
form.Show()

'Get program config, start threads, and close splash screen
'This method calls the method listed below as a new thread
Configuration.BeginProgram()
Thread.CurrentThread.Sleep(5000)
form.Close()
form.Dispose()

'Wait for all other threads to start
Thread.CurrentThread.Sleep(10000)

'Check to make sure that main processing thread is still running. If
not, close NotifyIcon
While Configuration._prgActive
Thread.CurrentThread.Sleep(1000)
Dim temp As Int64 = DateDiff(DateInterval.Minute,
Configuration._threadCheck, Now)
If (temp > 3 * Configuration._TimerPeriod) Or (temp < -3 *
Configuration._TimerPeriod) Then
notifyIcon.Visible = False
End If

End While

If Not notifyIcon Is Nothing Then notifyIcon.Dispose()

End Sub

Private Sub notifyIcon_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles notifyIcon.Click
MsgBox("NotifyIcon Clicked!")
End Sub
End Module

From the class that runs the main processing thread...

Public Shared Sub StartMainThread()
Startup.notifyIcon = New NotifyIcon
Startup.notifyIcon.Visible = True

While (Configuration._prgActive And Configuration._monitorOn)
'Do stuff
End While
Startup.notifyIcon.Visible = False
End Sub

Any ideas?

Thanks,
Rich Williams
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top