Re: Customizing Windows with C#

From: Stoitcho Goutsev \(100\) [C# MVP] (100_at_100.com)
Date: 10/27/04


Date: Wed, 27 Oct 2004 19:32:01 -0400

Hi,

IMHO even in cpp and native programing this is done via hooks there is no
other way around

Take a look at this MSDN Magazine article it can be a good start.

 Anyways, I doubt it can be done from pure managed code. Global windows
hooks except 2 of them can not be writen in managed code. The hooks that
might help you in this are not among supported ones. What you can do is to
customize only dialog boxes open from your process.
Otherwise the solution that will work is to write the hook in native code
and put the code in DLL then using PInvoke you can use it.

-- 
HTH
Stoitcho Goutsev (100) [C# MVP]
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in 
message news:%23HT8bLEvEHA.2016@TK2MSFTNGP15.phx.gbl...
> Tamir,
>
>    Yes, I would think it is.  You would have to do some heavy API work 
> though.
>
>    Generally speaking, you might just want to set up a system wide hook, 
> and handle the WM_CREATE message.  Then, you would change the properties 
> of the window as it is created.
>
>    Of course, this will cause a perf hit (system wide hooks usually do), 
> and there are some caveats with creating a system wide hook.
>
>    Check out codeproject.com and look for System Hook.  There should be an 
> article there on how to do it in .NET (I was looking at it yesterday, so I 
> am pretty sure it is there).
>
>
> -- 
>               - Nicholas Paldino [.NET/C# MVP]
>               - mvp@spam.guard.caspershouse.com
>
> "Tamir Khason" <tamir-NOSPAM@tcon-NOSPAM.co.il> wrote in message 
> news:OxJUjJEvEHA.1308@TK2MSFTNGP09.phx.gbl...
>> Thank you for response, but the question is "How to change ALL e.g dialog 
>> boxes in current Windows installation, not just in my project". This 
>> means that I have to handle each Dialog base class invoked by OS. Is it 
>> possible?
>>
>> -- 
>>        Tamir Khason
>> You want dot.NET? Just ask:
>> "Please, www.dotnet.us "
>>
>> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote 
>> in message news:uKas6BEvEHA.3728@TK2MSFTNGP12.phx.gbl...
>>> Tamir,
>>>
>>>    Yes, it is.  The Handle property on the Form class (or Control class) 
>>> gives you access to the Windows handle, which you can pass to any API 
>>> method you wish that accepts it.
>>>
>>>    However, I would make sure that there isn't something in the 
>>> framework that doesn't already provide the functionality you need. 
>>> Check out the article on MSDN titled "Microsoft Win32 to Microsoft .NET 
>>> Framework API Map", located at (watch for line wrap):
>>>
>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/win32map.asp
>>>
>>>    It will show you the functionality that .NET provides as it relates 
>>> to Win32 API functions.
>>>
>>>    Hope this helps.
>>>
>>>
>>> -- 
>>>               - Nicholas Paldino [.NET/C# MVP]
>>>               - mvp@spam.guard.caspershouse.com
>>>
>>> "Tamir Khason" <tamir-NOSPAM@tcon-NOSPAM.co.il> wrote in message 
>>> news:%23aSnclDvEHA.1452@TK2MSFTNGP11.phx.gbl...
>>>> Is it possible? or just my fantasy?
>>>> I did it before with cpp. Handle and change base classes such as 
>>>> dialogs, windows etc.
>>>> Is it possible to do with C#? Someone knows good reference to such kind 
>>>> of programming?
>>>>
>>>> TNX
>>>>
>>>> -- 
>>>>        Tamir Khason
>>>> You want dot.NET? Just ask:
>>>> "Please, www.dotnet.us "
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


Relevant Pages

  • Re: Intercept windows messager on WindowsCE
    ... Paul G. Tobey ha scritto: ... approaching to Windows programming only and I'm almost obliged to ... HHOOK SetWindowsHookEx( ... frankly, not sure if it will do journaling or getmessage hooks, ...
    (microsoft.public.windowsce.app.development)
  • Re: Intercept windows messager on WindowsCE
    ... The last time I checked, yes, they were the only ones supported for windows ... This has to do with how Unicode/ANSI declarations are ... HHOOK SetWindowsHookEx( ... frankly, not sure if it will do journaling or getmessage hooks, ...
    (microsoft.public.windowsce.app.development)
  • Re: Hooks to all external events
    ... You would want to study SetWindowsHook but I'm afraid you are probably ... I would say this is definitely the most advanced topic in Windows. ... you'll need to use the hooks to try and figure out what they mean the user ... > these a matter of finding the correct libraries for each or is there a ...
    (microsoft.public.vc.mfc)
  • Re: simulate mouse click - windows
    ... I'm writing program for windows, which is going to communicate by RS232 with my home-made device. ... if you need to take control of the whole system, you should try Hooks. ...
    (comp.lang.ada)
  • Re: File System hook
    ... Today windows can have 0 to N ... software that hooks. ... Get the IFS kit from>> Micrsoft and create a file system filter driver, ... >> Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.win32.programmer.kernel)