473,806 Members | 2,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1395
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.co m

"Tamir Khason" <ta**********@t con-NOSPAM.co.il> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.c om> wrote in
message news:uK******** ******@TK2MSFTN GP12.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.co m

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

"Tamir Khason" <ta**********@t con-NOSPAM.co.il> wrote in message
news:Ox******** ******@TK2MSFTN GP09.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.c om> wrote
in message news:uK******** ******@TK2MSFTN GP12.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.co m

"Tamir Khason" <ta**********@t con-NOSPAM.co.il> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.c om> wrote in
message news:%2******** ********@TK2MSF TNGP15.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.co m

"Tamir Khason" <ta**********@t con-NOSPAM.co.il> wrote in message
news:Ox******** ******@TK2MSFTN GP09.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.c om> wrote
in message news:uK******** ******@TK2MSFTN GP12.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.co m

"Tamir Khason" <ta**********@t con-NOSPAM.co.il> wrote in message
news:%2******** ********@TK2MSF TNGP11.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
6699
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 ( AxMSFlexGridLib.AxMSFlexGrid oGrid,
3
4847
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 possible to override the ShowDialog() method so that i can induce my own windows form dialog..? --need help -----seash
4
1682
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 using the Page Setup box. In window forms is possible using System.Drawing.Printing. But in web forms, it doesn't function.
3
1808
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 draw this control? Anyway, any pointers to examples would be most appreciated as all I seem to find is examples of customizing the details view. Cheers loads in advance!! Nick.
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10624
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10111
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.