.net - Handle in a console app -


I have a console app in .NET that I am doing some processing of fonts I am using Win32APIs for it And one of them needs a device reference to load the font - actually a IntPtr hdc = GetDC (the operation of the screen element) . Obviously, this app is not in my handle because it is a console app, is there any way to get rid of it?

IntPtr hdc = GetDC (System.Diagnostics.Process.GetCurrentProcess (). MainWindowHandle); works fine in the .Net console application.

I do not believe that it will work in null . As the net it can not convert error, logic: from '& lt; Null & gt; to 'System.IntPtr'


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -