system hook?

  • Thread starter Thread starter Michael Roper
  • Start date Start date
M

Michael Roper

Well, actually I'm not sure that's what I need.

What I'd like to do is write an app for the tray that can monitor any app
that gets launched and do a 'window size and position' on it based on
whatever info is available for it (like say, its command line). This is
part exercise, and part annoyance rectification.

Any tips on how best to proceed would be appreciated.

Michael Roper
 
Hi Michael,

In .net, it is not convinient to implement global hook.
To implement a global hook, you must make the hook proc in a dll
and inject it into every process's space, so I recommand you using VC++
to write your system monitoring application.

To solve you problem, you can use WH_SHELL and in the ShellProc when
the nCode HSHELL_WINDOWCREATED adjusting your window.

I think you must implement all these operation in a win32 dll and export
some
function.
Then in the C# application, you can interop with this dll and inject it
into every
process's space.

If you still have any question, please hesitate to let me know, we are glad
to
help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Michael Roper" <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: system hook?
| Date: Sat, 6 Sep 2003 19:44:11 -0700
| Lines: 12
| Message-ID: <[email protected]>
| NNTP-Posting-Host: ca.encraft.com (208.211.152.40)
| X-Trace: news.uni-berlin.de 1062902653 18966002 208.211.152.40 (16
[160215])
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.0
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!ca.encraft.COM!not-for-m
ail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:182905
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Well, actually I'm not sure that's what I need.
|
| What I'd like to do is write an app for the tray that can monitor any app
| that gets launched and do a 'window size and position' on it based on
| whatever info is available for it (like say, its command line). This is
| part exercise, and part annoyance rectification.
|
| Any tips on how best to proceed would be appreciated.
|
| Michael Roper
|
|
|
 
Back
Top