system hook?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Roper

    #1

    system hook?

    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


  • Jeffrey Tan[MSFT]

    #2
    RE: system hook?


    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_WINDOWCR EATED 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" <michaelr@encra ft.com>
    | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
    | Subject: system hook?
    | Date: Sat, 6 Sep 2003 19:44:11 -0700
    | Lines: 12
    | Message-ID: <bje61s$i2pfi$1 @ID-160215.news.uni-berlin.de>
    | 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.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-onlin
    e.de!newsfeed.f reenet.de!fu-berlin.de!uni-berlin.de!ca.en craft.COM!not-for-m
    ail
    | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1829 05
    | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
    |
    |
    |

    Comment

    Working...