Oct 29 2008

SendKeys in C#

Category: C#[email protected] @ 09:46

I had a need to execute some Windows Keystrokes in an application we are developing inside Windows Explorer, it is a Shell Namespace Extension, a virtual drive for an in-house EDMS. The keystroke to execute was an "F5" key. In other words, after performing an operation, I wanted to programamtically hit F5.

I posted on one of the forums and they refered me to this article: SendKeys in C++. It happened that this article is also written by a Lebanese guy, Elie :)

So I read this article and tried to search for SendKeys in C# and found a link to the System.Windows.Forms.SendKeys class that you can reach here: SendKeys in C#. Not only this class can be used within Windows Applications, but also within applications developed against Windows operating system itself, mainly a Shell Namespace Extension.

The way to execute a keystroke is simply call the following:



That's all what you need to do!



Oct 28 2008

Windows Azure

Category:[email protected] @ 20:01

My colleague at work had the chance this year to participate in PDC 2008, and she informed us today about the Windows Azure.

Check more information here: www.azure.com


It is a new life we have to start now :D

Hope you like it!





Oct 24 2008

Creating a Dynamic Data-Driven User Interface

Category: ASP.NET 2.0[email protected] @ 14:27

Scott Michelle has an amazing series on building Dynamic Data-Driven User Interfaces with ASP.NET. You can check the series here:

Part 1

Part 2

Part 3

Part 4


Enjoy the series!


Oct 23 2008

XAML Intellisense Broken in VS 2008

Category: VS 2008 | WPF | XAML[email protected] @ 15:34

I faced a problem today where the XAML Intellisense was broken inside the XAML Browser in VS 2008. I researched a bit on the internet and found the following link that helped me solve the problem. The problem appears when you install the Windows SDK after you have installed VS 2008.

Here is the link: Installing Win SDK after VS2008 breaks XAML Intellisense


Hope this helps,

Tags: , ,

Oct 21 2008

this.Age++; (2008)

Category: Personal[email protected] @ 21:24

Yes true, today (October 22nd 2008) is my 28th birthday.

I usually don't celebrate this ceremony, doesn't mean much for me in fact, just a date that made me open my eyes on this life. Fine, no problem.

Usually when it is someone's birthday, they say "Happy Birthday". What if that person is not that happy? Will it be "Sad Birthday"? Fair enough

28 years of what?
Childhood during civil war in Lebanon? Fine
Not interesting schools? Fine

Good/Sad/Painful days at university? Fine
Graduating with 3 majors and average of 94/100? Not bad

Bad/Depressing days in my military service? Fine

Working at the first company for one year? Not bad
Working for CCC for the last 3 years? Not bad

Getting an MVP? Good
Nominating others for being MVPs? True

Author, publishing articles? hmmm, well good
Author publishing a book? Again it is better

Person with a caring family? Perfect
Person caring for his family? Again it is perfect

Person helping others? Wow nice
Person getting help from others? Thank you

Person feeling love? Good
Person feeling hatred? Too bad

Person hurting others? Too bad, didn't mean this usually
Person getting hurt from others? It is a fact, but you can be forgotten like anyone else ....

Person breaking others' hearts? True, mistkanes happen sometimes
Person with broken heart? It is ok, what is important others to be happy, you broken heart? Nah, not a big deal.... Stay cool


Well, the only thing *Happy* for the above, I tried and always try to live my life on *My Way*. And here I am today, celebrating my birthday on *My Way*, with my own words and thoughts, wishing all those whose birthday is same as mine, a good and happy birthday.

It is not what you own, it is what you give.
It is not what you think, it is what you do.
It is not what they want, it is what you want.
It is not the age, it is the spirit.
It is not the birthday; it is the years passing....
It is not what happenED, it is what WILL happen....

Finally, I would like to dedicate, myself and all those who were born on the same day, the song "I Did It My Way".

And now, the end is here
And so I face the final curtain
My friend, I'll say it clear
I'll state my case, of which I'm certain
I've lived a life that's full
I traveled each and every highway
And more, much more than this, I did it my way

Regrets, I've had a few
But then again, too few to mention
I did what I had to do and saw it through without exemption
I planned each charted course, each careful step along the byway
And more, much more than this, I did it my way

Yes, there were times, I'm sure you knew
When I bit off more than I could chew
But through it all, when there was doubt
I ate it up and spit it out
I faced it all and I stood tall and did it my way

I've loved, I've laughed and cried
I've had my fill, my share of losing
And now, as tears subside, I find it all so amusing
To think I did all that
And may I say, not in a shy way,
"Oh, no, oh, no, not me, I did it my way"

For what is a man, what has he got?
If not himself, then he has naught
To say the things he truly feels and not the words of one who kneels
The record shows I took the blows and did it my way!




Oct 21 2008

Squash ... My Baby!!

Category:[email protected] @ 17:25

I started lately playing squash and I am really enjoying it day after day. What took my intention more today is a group on Facebook called "Top 20 Reasons to Date a Squash Player". Hehehe, everything in life has a group nowadays on Facebook :)

Read what the group says on those 20 reasons, and watch out girls/guys :D



1.we like it hard and fast against the wall
2.we're used to having bruises on our knees
3.we're used to performing in minimal amounts of clothing
4.after 90 seconds we're ready to go at it again
5.we don't mind getting hot and sweaty
6. we're always open to new moves & positions
7. we perform to please the crowd
8. we know where the sweet spot is
9. we show off our legs
10. we like being videotaped to improve ourselves
11. we enjoy doing hard things
12. we're always on top of the ball
13.we hit from any angle
14. we're good with our hands
15. we know how to play doubles
16. we like to be on top of our game
17. we know how to take it up the middle
18. we play the court until we score
19. We can do it forehand and backhand.
20. one word..FLEXIBILITY


Happy Squashing ......


Oct 16 2008

Silverlight 2.0 Released!

Category: silverlight 2.0[email protected] @ 12:21

Silverlight 2 is now released officially.

Check Scott's post here for more information: Silverlight 2 Released




Oct 11 2008

HP dv2000 Laptop for Sale!

Category:[email protected] @ 18:22

Laptop HP DV2000

Intel Core Duo CPU - T7500 @ 2.20 GHz 2.20 GHz

Memory (RAM) - 4 GB

32-bit Operating System (Windows Server 2008 - original copy)

14.1" screen


For more details on specs: http://asia.cnet.com/reviews/notebooks/0,39050490,39259551p,00.htm 

The price is 1200$. If you are interested, send me an email @ bhaidar at gmail.com




Oct 2 2008

Using SvcUtil.exe to generate Client Proxy for TCP Endpoints

Category: WCF[email protected] @ 09:22

I started lately learning WCF and going step by step with the concepts. However, today I was stuck by how to generate a proxy client class for a Host application that exposes a Service with a TCP endpoint.

Assume in the App.config configuration file, in the Host application (Console Application), you have the following configuration:

            <service name="WCFFromScratch.Service1" behaviorConfiguration="serviceBehavior">       
                <endpoint address="Service1" binding="netTcpBinding" contract="WCFFromScratch.IService1" />
                <endpoint contract="IMetadataExchange" binding="mexTcpBinding" address="mexTcp" />
                        <add baseAddress="net.tcp://localhost:9000"/>
                <behavior name="serviceBehavior">
                    <serviceMetadata httpGetEnabled="true"/>

The first important thing to notice in the above is the line in bold. Using the *mexTcpBinding* enables exposing meta data for the TCP endpoint and hence, using now the Svcutil.exe as follows:

c:\Program Files\Microsoft Visual Studio 9.0\VC>svcutil /d:C:\ /o:serviceProxy.cs /config:app.config net.tcp://localhost:9000/mexTcp

The above is enough to generate a new proxy client class named *serviceProxy.cs* located in the *C:\* drive.

Notice how I used the *mexTcp* address, which is the one that exposes meta-data for the SvcUtil in order to be able to generate the proxy.

For more information on publishing meta-data for a service, check the following: How to: Publish Metadata for a Service Using a Configuration File

Hope this helps,