473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Nov 15 '05 #1
1 2436

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" <mi******@encraft.com>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: system hook?
| Date: Sat, 6 Sep 2003 19:44:11 -0700
| Lines: 12
| Message-ID: <bj************@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.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.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
|
|
|

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex | last post by:
I am trying to determine if C# has the capabilities to listen for system events when the application does not have the window's focus. I am writing a windows application that I would like to run...
0
by: BFree | last post by:
I need to develop a system hook that will trigger whenever a disk is inserted into the system (needs to cover all possible disks.) There's got to be a windows message that I can watch for, but I...
1
by: murl | last post by:
I have been reading alot about local system hooks, and am able to inject a c# built system hook into a thread outside of my app but unsuccessfully, the program crashes(ie: notepad keyboard hook for...
9
by: Jesse | last post by:
Hi All, I want to be able to make an engine in VB.Net which creates a bridge between applications and the system registry, so before it's processed by the O/S, I want to be able to have the...
3
by: Patrick | last post by:
I have been developing in VB6 for years. I am converting to VB.net. I was wondering if it is possible to create a System hook in VB.net. I know that I VB6, I could not, so I created one in C++. ...
10
by: Crouchie1998 | last post by:
Hello To All You Real Programmers Out There!! There is an application called: "Tray It" Webpage: ---------- http://www.teamcti.com/trayit/trayit.htm Direct Download:
7
by: jpierson | last post by:
Hi, I am tryin to create a keyboard hook that sends the keystroke ctrl + pause/break. I haven't used keyboard hooks before so I'm not too sure how to use them public int MyKeyboardProc(int...
2
by: Gambero | last post by:
Hi, i want to do system hook WH_SYSMSGFILTER, my code is: IntPtr hMod = Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()); //install hook hSysMsgHook =...
22
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.