Groups | Blog | Home
all groups > dotnet windows forms > july 2005 >

dotnet windows forms : Desktop Form


fliversen
7/7/2005 12:00:00 AM
Hello,

for some reasons like
- create a font (without a real form)
- dimension of desktop

I need access to a default Form / Desktop form.

In which way, it is possible with windows::forms.

In MFC I use 'GetDesktopWindow()'.

Is 'Win32-API GetDesktopWindow()' is only way ?

So long
Frank Iversen



Lloyd Dupont
7/8/2005 12:00:00 AM
[quoted text, click to view]
well, you don't need any Form for that, just new Font()

[quoted text, click to view]
well you don't need a font for that: Screen.AllScreens[0].WorkingArea?


[quoted text, click to view]

1. there is no such function in SWF (but you could always use your own
private invisible Form)
2. you could alway PInvoke GetDesktopWindow()

frank iversen
7/8/2005 9:29:29 AM
Hello,

[quoted text, click to view]

to set the correct size, I need the DpiY from a Graphics object.

But
-------
Form ^fm = gcnew Form();
Graphics ^g = fm->CreateGraphics();
int logy = g->DpiY;
g->Dispose();
fm = nullptr;
-----
this works, so I am happy. A real form is not necessary.


Frank Iversen

AddThis Social Bookmark Button