Introduction
Demonstrate how to get the handle of the tablecloth and draw a picture on it using DC
Sample Code
Using system; <br/> using system. collections. generic; <br/> using system. componentmodel; <br/> using system. data; <br/> using system. drawing; <br/> using system. LINQ; <br/> using system. text; <br/> using system. windows. forms; <br/> using system. runtime. interopservices; </P> <p> namespace drawdesktop <br/> {<br/> Public partial class form1: Form <br/>{< br/> Public form1 () <br/>{< br/> initializecomponent (); <br/>}</P> <p> private void form1_load (Object sender, eventargs E) <br/>{< br/> intptr HDC = getdcex (get1_topwindow (), intptr. zero, 1027); <br/> using (Graphics G = graphics. fromhdc (HDC) <br/>{< br/> G. fillellipse (brushes. red, 0, 0,400,400); <br/>}</P> <p> [dllimport ("user32.dll")] <br/> static extern intptr getasktopwindow (); </P> <p> [dllimport ("user32.dll")] <br/> static extern intptr getdcex (intptr hwnd, intptr hrgn, uint flags); <br/>}< br/>