Capture maximize events of any form

J

Jeremy Chapman

Is it possible to capture the maximize event of any open form? I want to
create an app that sits in the tray and performas a tast every time a window
is maximized.
 
H

Herfried K. Wagner [MVP]

Jeremy Chapman said:
Is it possible to capture the maximize event of any open form? I want to
create an app that sits in the tray and performas a tast every time a
window is maximized.

Handle the form's 'Resize' event and compare the value of its 'WindowState'
property to 'Maximized' threre.
 
J

Jeremy Chapman

I'm not handling th maximize from within the application though. What I
want to to do is override the maximize functionality of any window in the
system, so I need some kind of hook or system where I can capture any
applications window maximize event
 
S

Stoitcho Goutsev \(100\)

As I understand it, Jeremy wants to intercept resize events on windows in
all running applications, not only the forms of its app. I believe this is
not possible using managed code only. To accompilsh susch a task one needs
to resort to windows hooks (WH_GETMESSAGE). Global hook of this kind cannot
be implemented with managed code. AFAIK it can be implemented in unmanaged
DLL and used with PInvoke.
 

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