How to get HDC from Handle on PocketPC?

I want to use gdi32 to draw on ppc. When I use:
System.Drawing.Graphics g = Graphics.FromHwnd(this.Handle);
I see a exception: "'System.Drawing.Graphics does not contain definition for 'FromHwnd'"
Help me please.





Answer this question

How to get HDC from Handle on PocketPC?

  • Hooper

    hi,

    you need to use a win32 api GetDCto get the hdc because cannot use it directly, first of all define a variable from type pointer (IntPtr) and store the hdc value into it using the Win32.GetDC() function:

    IntPtr hdc = Win32.GetDC ( this.Handle );

    Best Regards,

    Mohamed Saleh



  • How to get HDC from Handle on PocketPC?