cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tigergrace
Level 6

HiddenNotification

Hello,

Does anyone can help to take a look this problem?

My purpose is that I do not want to show update or message again after user click the "do not show this again" to hide the update in software manager when lauch the application.

The problem is when I use the function below, the return vulue is 1 for update, 0 for message whatever I hide or show the update or message.And the other problem is that I can not find the function of RemoveAllHiddenNotification(), I do not why, because I have added the reference to my project.

NC = agt.GetNotificationCollection(PC);
for (int x = 1; x <= NC.Count; ++x)
{
FNCClient11Lib.Notification Notif = (FNCClient11Lib.Notification) NC;
Notif.GetProperty(FNCClient11Lib.NotificationProperty.NP_HIDDEN)


Thanks,
grace,
0 Kudos
(3) Replies
TimStVCS
Level 7

Hello Grace, if you are trying to hide the notifications then your getproperty statement needs to be made into a setproperty statement like so:

Notif.SetProperty(FNCClient11Lib.NotificationProperty.NP_HIDDEN, 1)

Hope this helps!

Tim
0 Kudos
tigergrace
Level 6

Tim,

Thanks for your reply. I just want to get the hidden property when the update is set to hidden by user, and then it will do not show the update when launch the application. I want to use gethiddennotification function, but it does not expose by com.

grace,
0 Kudos
TimStVCS
Level 7

Hello Grace, I have been able to develop my own function for this utilizing the NP_HIDDEN property. For example, if I wanted to loop through the Notification collection and show a message box for each notification that is hidden, I would use the following code:

NC = FNCAgent.GetNotificationCollection(PC)
If NC.Count = 0 Then
MsgBox("No Notifications are Available", MsgBoxStyle.OkOnly & MsgBoxStyle.Information)
End If
For index As Integer = 1 To NC.Count
Notif = NC.Item(index)
If Notif.GetProperty(FNCClient11Lib.NotificationProperty.NP_HIDDEN) = True Then
MsgBox("Notification is Hidden", MsgBoxStyle.OkOnly & MsgBoxStyle.Information)
End If
Next
End If

Hope this helps you out!

Tim
0 Kudos