Teach you to doodle on the table

Source: Internet
Author: User

I once said a famous saying: Graffiti is a great pleasure in life.

As long as you know the graffiti, graffiti is very fun. In the window to draw more, not happy, want to draw on the desktop? Don't be surprised, it's OK.

The graphics class can use a static method Fromhwnd to create an instance, and if you want to doodle on the desktop, just get the handle on the desktop. So how do you get the handle to the desktop? To use an unmanaged API, that is,

[DllImport ("User32.dll")]  
public extern static IntPtr GetDesktopWindow ();

Use it to get the handle of the desktop, as long as there is a handle, you can create graphics, as long as you create a graphics object, you want to draw a ghost on it, Ah Mao ah can be.

Just like I gave myself a speech today, let's enjoy my calligraphy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.