Remove CeRunAppAtEvent registrations

I'm having an awful time trying to get event triggered registrations to remove. It just plain isn't working. At this point I have a device with 2 or 3 registrations for the same event and same program. here is the line of code I'm using for the (attempted) unregistration:
CeRunAppAtEvent(path, NOTIFICATION_EVENT_NONE)

Here is all of the code, taken from the web:
Option Explicit On

Module RunAppOnActiveSync

Const NOTIFICATION_EVENT_NONE = 0
Const NOTIFICATION_EVENT_TIME_CHANGE = 1
Const NOTIFICATION_EVENT_SYNC_END = 2
Const NOTIFICATION_EVENT_DEVICE_CHANGE = 7
Const NOTIFICATION_EVENT_RS232_DETECTED = 9
Const NOTIFICATION_EVENT_RESTORE_END = 10
Const NOTIFICATION_EVENT_WAKEUP = 11 'PocketPC only
Const NOTIFICATION_EVENT_TZ_CHANGE = 12 'PocketPC only

Const APP_RUN_AT_TIME = "AppRunAtTime"

' * Prefix of the command line when the user requests to run the application
' * that "owns" a notification. It is followed by a space, and the
' * "stringized" version of the notification handle.

Const APP_RUN_TO_HANDLE_NOTIFICATION = "AppRunToHandleNotification"

'The application is started with a system-defined command
'line. If there was already an instance of the application
'running, the new instance must send a private message to
'the existing instance and then shut down. The command line,
'which corresponds to the registered event, can be one of
'the following string constants.

Const APP_RUN_AFTER_TIME_CHANGE = "AppRunAfterTimeChange"
Const APP_RUN_AFTER_SYNC = "AppRunAfterSync"
Const APP_RUN_AT_DEVICE_CHANGE = "AppRunDeviceChange"
Const APP_RUN_AT_RS232_DETECT = "AppRunAtRs232Detect"
Const APP_RUN_AFTER_RESTORE = "AppRunAfterRestore"

Declare Function CeRunAppAtEvent Lib "Coredll" ( _
ByVal pwszAppName As String, _
ByVal lWhichEvent As Long) As Boolean

Public Sub OpenProgramOnActiveSync(ByVal path As String)
CeRunAppAtEvent(path, NOTIFICATION_EVENT_RS232_DETECTED)
End Sub

Public Sub DontOpenProgramOnActiveSync(ByVal path As String)
CeRunAppAtEvent(path, NOTIFICATION_EVENT_NONE)
End Sub
End Module



Answer this question

Remove CeRunAppAtEvent registrations