Calendar reminder window not getting focus

S

stan.mitchell1

Hello, I'm new to this group so please be kind.

I found the following code by "Gullu" on the superuser.com site and tried it in Outlook 2010 because 1) office etiquette requires no sounds and 2) theReminder window remains behind all other windows, causing me to miss meetings. Although the taskbar icon flashes but apparently that isn't visible enough for me to notice.

The problem is, it doesn't work consistently. Sometimes the first reminderdoes not result in the reminder appearing on top until after one reminder is received and dismissed.

Has anyone had any success either using this or some other method of showing reminders on top?

Thanks!

Here is the code:

Private Declare PtrSafe Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare PtrSafe Function SetWindowPos Lib "user32" ( _
ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1

Private Sub Application_Reminder(ByVal Item As Object)
On Error Resume Next
ReminderWindowHWnd = FindWindowA(vbNullString, "1 Reminder")
SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS

End Sub
 

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