Click here to Skip to main content
15,891,775 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: 3-in-1 project? Pin
Mark Salsbery27-Oct-06 7:00
Mark Salsbery27-Oct-06 7:00 
GeneralRe: 3-in-1 project? Pin
Joe Smith IX28-Oct-06 9:51
Joe Smith IX28-Oct-06 9:51 
GeneralRe: 3-in-1 project? Pin
Mark Salsbery29-Oct-06 7:26
Mark Salsbery29-Oct-06 7:26 
AnswerRe: 3-in-1 project? Pin
led mike27-Oct-06 7:15
led mike27-Oct-06 7:15 
QuestionRe: 3-in-1 project? Pin
David Crow27-Oct-06 7:17
David Crow27-Oct-06 7:17 
AnswerRe: 3-in-1 project? Pin
Zac Howland27-Oct-06 7:28
Zac Howland27-Oct-06 7:28 
AnswerRe: 3-in-1 project? Pin
Gary R. Wheeler29-Oct-06 2:21
Gary R. Wheeler29-Oct-06 2:21 
QuestionGDI+ graphics returns 0 visible clip rect for secondary monitor Pin
gkitts27-Oct-06 5:12
gkitts27-Oct-06 5:12 
Greetings everyone,

I'm working on a screensaver that I'd like to use GDI+ with (to display alpha-blended images, etc). What I'm trying to accomplish is to paint the desktop with background images, so to handle this I'm calling EnumDisplayMonitors from within my message pump (in the WM_PAINT case).
I'm correctly getting the callback against my MonitorDisplayProc, and since I bracket the EnumDisplayMonitors call with GetDC(null), ReleaseDC(null, hdc), I'm able to pass the DC that (should) correspond to the virtual desktop to EnumDisplayMonitors.

Inside of MonitorDisplayProc, I'm able to take the provided hdcMonitor and lprcMonitor vars and paint to the relevant display via FillRect(hdcMonitor, lprcMonitor, (HBRUSH) GetStockObject(BLACK|GRAY|WHITE_BRUSH)). So far, so good.

Now, when I use the hdcMonitor object to create a GDI+ Graphics object, it seems to work okay for the primary monitor. I can load an Image from disk and draw to the primary screen just fine.

However, when my MonitorDisplayProc gets the callback for my second display, graphics.GetVisibleClipBounds(&clipRect) is returning a {0,0,0,0} rect. Appropriately, graphics.isVisible(...) is also failing.

Reading the MSDN docs for GetVisibleClipBounds makes me believe something in the hdcMonitor object is incorrect, but I'm having a hard time proving it - I'm trying to fetch the hdcMonitor's bounding box via GetRandomRgn(hdcMonitor, hRgn, SYSRGN) but that is returning 0's when I pass it into region.GetBounds(...). This makes me think I'm misunderstanding something about graphics's world/page/device conversion, but I'm not sure.

There's lots of documentation on the web about C# using forms, but I'm having a rough time finding anything that directly references this problem either via Google or MSDN.

Does anybody out there have any idea why Gdiplus::Graphics would be reading a HDC 'improperly' as specified above? Any help would be *greatly* appreciated.
Questionmessage loop in directx Pin
shaderx27-Oct-06 5:00
shaderx27-Oct-06 5:00 
AnswerRe: message loop in directx Pin
Zac Howland27-Oct-06 8:00
Zac Howland27-Oct-06 8:00 
QuestionCDialog Pin
baerten27-Oct-06 4:50
baerten27-Oct-06 4:50 
AnswerRe: CDialog Pin
Mark Salsbery27-Oct-06 5:33
Mark Salsbery27-Oct-06 5:33 
AnswerRe: CDialog Pin
Hamid_RT27-Oct-06 21:39
Hamid_RT27-Oct-06 21:39 
GeneralRe: CDialog [modified] Pin
baerten29-Oct-06 21:25
baerten29-Oct-06 21:25 
QuestionHow to check thread.? Pin
Max++27-Oct-06 4:22
Max++27-Oct-06 4:22 
AnswerRe: How to check thread.? Pin
Mike Dimmick27-Oct-06 4:26
Mike Dimmick27-Oct-06 4:26 
GeneralRe: How to check thread.? Pin
Max++27-Oct-06 4:32
Max++27-Oct-06 4:32 
GeneralRe: How to check thread.? Pin
benjymous27-Oct-06 5:06
benjymous27-Oct-06 5:06 
GeneralRe: How to check thread.? Pin
led mike27-Oct-06 5:11
led mike27-Oct-06 5:11 
GeneralRe: How to check thread.? Pin
ThatsAlok28-Oct-06 2:01
ThatsAlok28-Oct-06 2:01 
Questionproblem using WideCharToMultiByte() Pin
priyank_ldce27-Oct-06 3:54
priyank_ldce27-Oct-06 3:54 
AnswerRe: problem using WideCharToMultiByte() Pin
Nemanja Trifunovic27-Oct-06 4:11
Nemanja Trifunovic27-Oct-06 4:11 
QuestionDirectX license Pin
Daniel Kanev7-Mar-17 10:45
Daniel Kanev7-Mar-17 10:45 
AnswerRe: DirectX license Pin
Zac Howland27-Oct-06 3:33
Zac Howland27-Oct-06 3:33 
AnswerRe: DirectX license Pin
Mark Salsbery27-Oct-06 5:36
Mark Salsbery27-Oct-06 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.