473,320 Members | 1,921 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,320 software developers and data experts.

Customizing Windows with C#

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 "
Nov 16 '05 #1
4 1377
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/de...l/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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@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 "

Nov 16 '05 #2
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]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uK**************@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/de...l/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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@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 "


Nov 16 '05 #3
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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:Ox**************@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]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uK**************@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/de...l/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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@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 "



Nov 16 '05 #4
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]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:Ox**************@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]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uK**************@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/de...l/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]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@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 "



Nov 16 '05 #5

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

Similar topics

4
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
3
by: seash | last post by:
Hi I need an OpenFileDialog with my own gui of the dialog box. i want to use the functionality given by the object of the OpenFileDialog component with my own dialogbox....have any ideas... Is it...
4
by: Lucas Correa | last post by:
Hi, I am trying to customize printing for a webpage, setting the top and left margin, and cleaning the header and footer. The idea is to customize printer without user interaction, and don't...
3
by: Nick | last post by:
Hi there, I'm hunting around for some kind of example on how to customize the largeicons view of a listview control, I would like to draw each item myself if possible, is it possible to owner...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.