Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / August 2007

Tip: Looking for answers? Try searching our database.

ForeGroundWindow Issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerod Houghtelling - 29 Aug 2007 21:46 GMT
Hi all,

Does anybody know of a way to have a C# PPC/WM application receive
notification when a window is brought to the foreground. Catching the
forms Deactivate and LostFocus events are not good enough. I need to
be able to globally catch the event when an window is brought to the
foreground. Currently I'm doing this with GetForegroundWindow() and a
Timer checking to see if the current foreground window is different
then the last time I checked. This seems extremely inefficient so I
was hoping that maybe I could register an event or use
WaitForSignalObject if I knew the event name.

Any help would be extremely appreciated!

Thanks,
Jerod
Paul G. Tobey [eMVP] - 29 Aug 2007 22:58 GMT
There's no event fired.  That event would be constantly firing, if there
were.  What are you trying to achieve with this (boils down to why you need
to know that a change in the foreground window is being made)?  There might
be another way or a different sort of suggestion that we could offer.

Paul T.

> Hi all,
>
[quoted text clipped - 12 lines]
> Thanks,
> Jerod
Jerod Houghtelling - 29 Aug 2007 23:33 GMT
On Aug 29, 3:58 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> There's no event fired.  That event would be constantly firing, if there
> were.  What are you trying to achieve with this (boils down to why you need
[quoted text clipped - 19 lines]
> > Thanks,
> > Jerod

I'm trying to mimic HHPs EZMenu program. (Looks and acts like the
Programs menu but the start icon must be hidden from ALL programs.) My
requirement is that the task bar must be visible, but the start icon
hidden. It is also not sufficient enough for me to make the window
full screen. I'm referring to removing the start icon because it
essentially locks the task bar. Plus I don't want the user thinking
that it is locked up if I just disable the task bar because the start
icon is still visible.
Paul G. Tobey [eMVP] - 30 Aug 2007 00:18 GMT
I'm afraid that I'm not familiar with it.  It's a shell replacement
(explorer.exe is *not* in the registry Init keys while this program is in
charge)?  I can certainly see how to accomplish *that* with a clone of the
explorer and suitable changes to the code (native, of course).

So, you need to know who is in front because you want to indicate on your
taskbar who is active by showing the 'button' in the down state or something
of that sort?  It appears to me that the window manager automatically
notifies the shell of those transitions, but not any other applications.
The mechanism for asking for them is pretty opaque...

Paul T.

> On Aug 29, 3:58 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
> no instrument no spam DOT com> wrote:
[quoted text clipped - 32 lines]
> that it is locked up if I just disable the task bar because the start
> icon is still visible.
Paul G. Tobey [eMVP] - 30 Aug 2007 00:32 GMT
I've just found the code in the window manager that does that and it *does*
only send the message to the task bar.  Seems like that's probably the best
way to go (replace the shell), if this is intended for a device where you
are in control of what should be installed on the device at all times.

Paul T.

> I'm afraid that I'm not familiar with it.  It's a shell replacement
> (explorer.exe is *not* in the registry Init keys while this program is in
[quoted text clipped - 45 lines]
>> that it is locked up if I just disable the task bar because the start
>> icon is still visible.
Paul G. Tobey [eMVP] - 30 Aug 2007 00:40 GMT
Ah, and there's where the taskbar is registered with the window manager,
RegisterTaskBar().  Sorry, only one task bar allowed per system (and there
are restrictions mentioned in the help).

Paul T.

> I've just found the code in the window manager that does that and it
> *does* only send the message to the task bar.  Seems like that's probably
[quoted text clipped - 54 lines]
>>> that it is locked up if I just disable the task bar because the start
>>> icon is still visible.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.