GetDC,0 -> EnumDisplayMonitors -> No results ?

Giganews Newsgroups
Subject: GetDC,0 -> EnumDisplayMonitors -> No results ?
Posted by:  R.Wieser (addre…@not.available)
Date: Sun, 24 Jan 2021

Hello all,

I've just connected a second monitor to my 'puter and am looking a the
results returned by the "EnumDisplayMonitors" (user32.dll) call.  The
callback returns both monitors *as long as* I provide a NULL as the DC
argument (and the clipping rectangle argument).

When I set the DC argument to the output of "GetDC,0" (which should return
the DC of the desktop) neither the primary nor the secondary monitor is
shown.

I must be misunderstanding something, but I have no idea what ... :-(

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdisplaymonitors

Regards,
Rudy Wieser

Replies