.net - How to Detect a form open inside the application -
is possible detect when form opens inside application?
i have assembly used , initialized several applications. need use assembly detect, when form inside application opens, able modify it.
the solution found, yet, using messagefilter, edit: most efficient way getting notified on window open - ask windows in processes want windows in own process. since i'm interested in own application/process hope find sole .net solution.
application.addmessagefilter(new messagefilterimpl()); class messagefilterimpl : imessagefilter { public bool prefiltermessage(ref message m) { control wnd= form.fromhandle(m.hwnd); if (wnd form) knownforms.add((form)wnd); return false; } }
i found first message receive 0xc052, still didn't find actual meaning.
the first intention choose better design, i'm not allowed to.
Comments
Post a Comment