How to trigger when any window/dialog opens within Windows
-
Please excuse me if this is an 'obvious' or 'trivial' question . . . I'm a C# newbie . . . familiar with VB5 (learning VB.NET and C#.NET), but this .NET arena is quite different :-O I would like to trigger an event when a window or dialog opens-up anywhere in the Windows environment. I wish my C# applet to take some action (specifically, to pop that window/dialog to the foreground of all other open windows) when it senses that a window/dialog has just appeared-on-the-scene; I don't want to trigger when a user merely "Restore"s (i.e. un-minimizes) an already-open application. I'm trying to write a 'tray' applet which watches for the Outlook2003 "Reminder" dialog (which often pops-up BEHIND open applications, thus not waking-me-up for my appointments ;-O ) and forcing it to the foregound . . . and possibly playing a 'sound' to get my attention. Any pointers on how to do that, or which keywords I should be using in searches? I've tried "trigger window open" (and similar words), but haven't stumbled upon anything useful yet. Thanx (in advance). Saber Of Borg
-
Please excuse me if this is an 'obvious' or 'trivial' question . . . I'm a C# newbie . . . familiar with VB5 (learning VB.NET and C#.NET), but this .NET arena is quite different :-O I would like to trigger an event when a window or dialog opens-up anywhere in the Windows environment. I wish my C# applet to take some action (specifically, to pop that window/dialog to the foreground of all other open windows) when it senses that a window/dialog has just appeared-on-the-scene; I don't want to trigger when a user merely "Restore"s (i.e. un-minimizes) an already-open application. I'm trying to write a 'tray' applet which watches for the Outlook2003 "Reminder" dialog (which often pops-up BEHIND open applications, thus not waking-me-up for my appointments ;-O ) and forcing it to the foregound . . . and possibly playing a 'sound' to get my attention. Any pointers on how to do that, or which keywords I should be using in searches? I've tried "trigger window open" (and similar words), but haven't stumbled upon anything useful yet. Thanx (in advance). Saber Of Borg
-
Please excuse me if this is an 'obvious' or 'trivial' question . . . I'm a C# newbie . . . familiar with VB5 (learning VB.NET and C#.NET), but this .NET arena is quite different :-O I would like to trigger an event when a window or dialog opens-up anywhere in the Windows environment. I wish my C# applet to take some action (specifically, to pop that window/dialog to the foreground of all other open windows) when it senses that a window/dialog has just appeared-on-the-scene; I don't want to trigger when a user merely "Restore"s (i.e. un-minimizes) an already-open application. I'm trying to write a 'tray' applet which watches for the Outlook2003 "Reminder" dialog (which often pops-up BEHIND open applications, thus not waking-me-up for my appointments ;-O ) and forcing it to the foregound . . . and possibly playing a 'sound' to get my attention. Any pointers on how to do that, or which keywords I should be using in searches? I've tried "trigger window open" (and similar words), but haven't stumbled upon anything useful yet. Thanx (in advance). Saber Of Borg
In Outlook, Tools - Options - Other tab - Adcanved Options button, Reminder Options button... If there was any example of a convoluted and misleading Options dialog, where you couldn't find anything you wanted, Outlook is it! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
In Outlook, Tools - Options - Other tab - Adcanved Options button, Reminder Options button... If there was any example of a convoluted and misleading Options dialog, where you couldn't find anything you wanted, Outlook is it! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Yes, I know . . . and the dialogs change with each version of Outlook . . . the old Outlook 2000 on Win2k seemed to work fine . . . always seemed to pop-up when it should . . . at home my Outlook 2002 on WinXPhome seems to work fine . . . always seems to pop-up when it should . . . the problem I'm having is with Outlook 2003 on WinXPpro . . . about half the time it pops-up behind the other open windows. And, YES, I have the option set that is supposed to force it to the front . . . but it still doesn't. I've tried un-setting the option, saving, then resetting the option, saving . . . thinking perhaps the registry entry where that is stored just needed a swift kick in the rump . . . no help. So, since their stupid s/w can't seem to get-the-hint I thought I'd write a background task that would take charge and do it for Mr Gate's Banta fodder. Plus, I use a math analysis tool called Mathcad which, when you launch it, is too dumb to pop to the front despite the fact that it opens "Maximized" . . . so, if figured I'd flush 2 turds with one stone :-O So, that being the case . . . any ideas how my VC# program can wake-up when a window or dialog (from another app) has just appeared?? TIA Saber Of Borg
-
This might possibly help me raise a form to the front once I know that a particular form needs to be brought to the front, but, I don't see now this will wake-up my application when some other application window has just opened. Please elaborate . . . Thanx. Saber Of Borg
-
Yes, I know . . . and the dialogs change with each version of Outlook . . . the old Outlook 2000 on Win2k seemed to work fine . . . always seemed to pop-up when it should . . . at home my Outlook 2002 on WinXPhome seems to work fine . . . always seems to pop-up when it should . . . the problem I'm having is with Outlook 2003 on WinXPpro . . . about half the time it pops-up behind the other open windows. And, YES, I have the option set that is supposed to force it to the front . . . but it still doesn't. I've tried un-setting the option, saving, then resetting the option, saving . . . thinking perhaps the registry entry where that is stored just needed a swift kick in the rump . . . no help. So, since their stupid s/w can't seem to get-the-hint I thought I'd write a background task that would take charge and do it for Mr Gate's Banta fodder. Plus, I use a math analysis tool called Mathcad which, when you launch it, is too dumb to pop to the front despite the fact that it opens "Maximized" . . . so, if figured I'd flush 2 turds with one stone :-O So, that being the case . . . any ideas how my VC# program can wake-up when a window or dialog (from another app) has just appeared?? TIA Saber Of Borg
Hi! You either poll the current windows (P/invoking
EnumWindows
) for a file dialog window (you can use Spy++ to find out the correct window class names), but that's not very elegant. Or you create a system-wide hook to inform you application that a special window has appeared - I think CTBHOOKs can monitor the creation of windows. The problem is that hook procedures in C# will not work in every case (injecting managed code into an unmanaged application can become a little tricky ;P), but since the hook procedure only has to inform you that a special window has appeared and perhaps transmit the HWND of this window, it should be possible to put together the proc in C++ by adapting one of the samples flowing around the net. HTH, Regards, mav -- Black holes are the places where god divided by 0... -
Yes, I know . . . and the dialogs change with each version of Outlook . . . the old Outlook 2000 on Win2k seemed to work fine . . . always seemed to pop-up when it should . . . at home my Outlook 2002 on WinXPhome seems to work fine . . . always seems to pop-up when it should . . . the problem I'm having is with Outlook 2003 on WinXPpro . . . about half the time it pops-up behind the other open windows. And, YES, I have the option set that is supposed to force it to the front . . . but it still doesn't. I've tried un-setting the option, saving, then resetting the option, saving . . . thinking perhaps the registry entry where that is stored just needed a swift kick in the rump . . . no help. So, since their stupid s/w can't seem to get-the-hint I thought I'd write a background task that would take charge and do it for Mr Gate's Banta fodder. Plus, I use a math analysis tool called Mathcad which, when you launch it, is too dumb to pop to the front despite the fact that it opens "Maximized" . . . so, if figured I'd flush 2 turds with one stone :-O So, that being the case . . . any ideas how my VC# program can wake-up when a window or dialog (from another app) has just appeared?? TIA Saber Of Borg
Saber Of Borg wrote:
So, since their stupid s/w can't seem to get-the-hint I thought I'd write a background task that would take charge and do it for Mr Gate's Banta fodder.
I've never had a problem with it not popping up. My fiancee has also never had a problem with that stupid reminder thing never popping up in front.
Saber Of Borg wrote:
Plus, I use a math analysis tool called Mathcad which, when you launch it, is too dumb to pop to the front despite the fact that it opens "Maximized"
It sounds more like you've got a problem with the system, or some other "tool", than these two applications. Perhaps something installed with the video driver?? I know ATI and NVidia has packaged some new toys in their driver packages. Or possibly some other tool that screws with Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Saber Of Borg wrote:
So, since their stupid s/w can't seem to get-the-hint I thought I'd write a background task that would take charge and do it for Mr Gate's Banta fodder.
I've never had a problem with it not popping up. My fiancee has also never had a problem with that stupid reminder thing never popping up in front.
Saber Of Borg wrote:
Plus, I use a math analysis tool called Mathcad which, when you launch it, is too dumb to pop to the front despite the fact that it opens "Maximized"
It sounds more like you've got a problem with the system, or some other "tool", than these two applications. Perhaps something installed with the video driver?? I know ATI and NVidia has packaged some new toys in their driver packages. Or possibly some other tool that screws with Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Do you and your fiancee use Outlook 2003 on WinXPpro? The Outlook reminders worked fine in Outlook 2000 on Win2k . . . and it works fine on my home system (Outlook 2002 on WinXPhome). I suspect that they changed (broke) something in Outlook 2003. Mathcad never popped to the front at work . . . Win2k or WinXPpro . . . but it does at home on WinXPhome. Perhaps there's something going-on with NOT being an Admin (aka SuperUser) at work? Regardless, it still sounds like an interesting learning experience to be able to do what I want to do :-) Saber Of Borg