Ovveriding Handle in C#

If one is making a composite control and needs to give the
inner control the user to work with , just ovveride the Handle
property.

// OuterControl.cs

public new IntPtr Handle {

get { return m_InnerControl.Handle; }

}

In C# Handle is derived from NativeWindow .

Ovveriding Handle is not recommended as this is a internal to Windows, so the user should be very confident while performing such operations.

Why did I get into C ?

Often I have been asked why did I chose C ; as there a plethora of languages available now. So I thought why not post it in the blog so it stays there for ever . Maybe this shall help me when I get old ….. :-))

During my academics I had to submit a project for course completion ; and there were two choices – C or FoxPro . Even though C was interesting it was a bit complex so I decided to work on FoxPro to get my project completed.

There were some friends and seniors who was working on C , and had created some great applications – it was great as I had seen those features in OS’s and to see them working with my freinds code was something AMAZING.

For example, one of them had done a project mimicking “Windows Explorer” and while one had done a “Net Chat “- a chatting program between two computer users on the same network . Even though it looked fascinating the complexity kept me away.

My project was coming in the closing stages and I wanted to add some splash screen to give it a zing ; after all it was my first computer project . So in came graphics ; at first I tried something with FoxPro but it had restrictions and thats when C graphics crossed my mind . I had casually worked on C graphics earlier , but this time it had to be serious stuff . After getting the basic help from the C teacher , I got into graphics programming .

My platform was DOS 6.22 and Windows 95 was just hitting the market. That time a new jargon had also hit the market …. “Windows Programming” and interested people were gearing up for it. To me the term itself seemed a bit confusing ; as I could not understand what to program in Windows .

What is there in Windows I need to program …. I thought it was all programmed , there was the new UI which was making waves across the world . We as students were allowed to see it sometimes as we did not know about the operations . With my restricted knowledge it seemed to me that things were pretty fine there ; then why need to program it. I was content with it and did not go further in unraveling what is “Windows Programming”. Little did I know on that day that this unraveled mystery shall turn out be my future earning.

Coming back to the main topic ; graphics in C were amazing to me at that point of time . If I compare todays graphics with my work at that time, todays graphics wins hands down. But one has to keep in mind that I was working on DOS 6.22 and even though astounding graphics could be perfomed there also I was just a beginer .

However this small piece of work gave me a great satisfaction ; and believe it or not I would have got a job also at that point of time, but thought of completing “Systems Programming” first before moving on for job.

With my graphics program there the problem was the interfacing . How do I call a C program from FoxPro … was my graphics program going to be in vain.

It turned out to be very simple solution …. and my basic project was over……. making it better was always there .

That was my first serious tryst with C and somehow the same satisfaction continues even now.

In my next post I shall write how I get into C++, Windows Programming and Visual C++ .