Re: BitBlt failing under XP with a locked screen saver
From: Christopher Bohn (cbohn_at_nospammingrrinc.com)
Date: 03/04/04
- Next message: vipin aravind: "Re: GetRegionData and disjoint rectangles"
- Previous message: a.m.a: "Re: GetRegionData and disjoint rectangles"
- In reply to: Rhett Gong [MSFT]: "Re: BitBlt failing under XP with a locked screen saver"
- Next in thread: Christopher Bohn: "Re: BitBlt failing under XP with a locked screen saver"
- Reply: Christopher Bohn: "Re: BitBlt failing under XP with a locked screen saver"
- Reply: David: "Re: BitBlt failing under XP with a locked screen saver"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 04 Mar 2004 10:52:09 -0500
What is the best approach to determine what the active desktop actually
is to determine if my app's desktop is active. If the app's desktop is
active, it is a real error I need to handle. If the app's desktop isn't
active (e.g., locked screen saver running in its own desktop), then I
can ignore the error. I have searched some groups and found approaches
that do things like:
HDESK threaddesktop = GetThreadDesktop(GetCurrentThreadId());
HDESK inputdesktop = OpenInputDesktop(...)
then get the name of each desktop through the GetUserObjectInformation
call, and then compare the names to see if they are the same. That
doesn't seem like a great approach, but after looking more, I don't see
many other choices. It would be nice if there was a simple way to get
the name of the active desktop (in which case, if it wasn't the input
desktop, as seen from OpenInputDesktop, then I could know the input
desktop wasn't active).
I haven't tried the example method indicated above yet, but it seemed
like GetThreadDesktop(GetCurrentThreadId()) would always return the
input desktop because the app is started on it, and I wouldn't think the
thread would change desktops just because a locked screen saver starts.
Chris
Rhett Gong [MSFT] wrote:
> Hi Dave,
> I am succeeded to repro it in my xp machine. It looks like the same problem with Chris.
> From my test, it returns ERROR_ACCESS_DENIED. Based on my search, It seems that most native applications ignore GDI errors so they never cause this problem.
> :(
>
> I agree with Chris that it should have an error named ERROR_NOT_AN_ACTIVE_DESKTOP_SO_CANT_DRAW, since it won't be drawn if the DC is not on an
> active desktop.
>
> One possible resolution is to catch and ignore this error in your app. I know this is not really a good approach, because there really is an error which could be
> handled earlier in the code path. Thanks for your understanding.
>
> Hope this helps.
> Rhett Gong [MSFT]
> Microsoft Online Partner Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Please reply to newsgroups only. Thanks.
- Next message: vipin aravind: "Re: GetRegionData and disjoint rectangles"
- Previous message: a.m.a: "Re: GetRegionData and disjoint rectangles"
- In reply to: Rhett Gong [MSFT]: "Re: BitBlt failing under XP with a locked screen saver"
- Next in thread: Christopher Bohn: "Re: BitBlt failing under XP with a locked screen saver"
- Reply: Christopher Bohn: "Re: BitBlt failing under XP with a locked screen saver"
- Reply: David: "Re: BitBlt failing under XP with a locked screen saver"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|