Capture maximize events of any form

  • Thread starter Thread starter Jeremy Chapman
  • Start date Start date
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.
 
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.
 
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
 
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.
 
Back
Top