How to clone a device-context?

Hi,

   I added two message-listeners (through subclassing) to the Progman
and SysListView32 windows. Here is what I observe:


(SysListView32) message=WM_PAINT,wParam=0, lParam=0,return=0
(SysListView32) message=WM_NCPAINT,wParam=0, lParam=0,return=0
(SysListView32) message=WM_ERASEBKGND,wParam=0, lParam=0,return=0
(SysListView32) message=LVM_GETBKCOLOR,wParam=0, lParam=0,return=0
(Progman) message=WM_ERASEBKGND,wParam=0, lParam=0,return=0

    What I see is that SysListView32 paints the desktop icons *before*
Progman draws the desktop wallpaper. Somehow the progman background is
being rendered underneath the explorer icons even though painting
occurs in opposite order.  I know that somehow the DC passed to
Progman WM_ERASEBKGND refers to the background of SysListView32 and
this paints *under* the icons but I have no idea how it configures
itself to paint under the icons. I would like to create a new HDC that
is somehow a clone of this original HDC and draws underneath the
icons.

    Can anyone please explain to me how this works? The reason I ask
is that I am creating a new DC inside Progman's WM_ERASEBKGND handler
and when I paint to it it is painting over the icons (as expected) but
I want it too to draw under the icons like the HDC passed in through
wParam.

Please help,
Gili Tzabari
0
4/28/2004 9:28:49 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
611 Views

Similar Articles

[PageSpeed] 5

Reply:

Similar Artilces:

Cloning Austin Powers (with modifications)
Hi, Does anyone know how to do the following, for example, please? Cell A1 shows: Austin Powers, International Man of Mystery. However I'd like cell A2 to copy the information, but delete everything from the comma onwards automatically. So cell A2 should show: Austin Powers Thanks for your help, Dan. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ Dan, Try the following formula. It works regardless of whether a comma exists in A1. =IF(ISERROR(FIND(",&...

Mobile Devices
We are getting a lot of mobile devices here on our campus. The Samsung i730 seems to be the favorite here. We are running Exchange 2003 SP1. We also have OMA setup. But it seems when this device goes to the OMA it still gets the OMA in Text base format - Is this device support for the OMA? What other ways can the Samsung i730 connect to our exchange 2003 server? We have read where Service Pack 2 for Exchange 2003 and the mobile pack will greatly improve these features. Any help would be appreciated? If this isn't the right newsgroup, please direct me to which on...

"free" ip number when I remove device from database, not delete?
Win 7, access 2007 , tables: device and ip, relation (device.ipIP, foreign)one-to-one(ip.ID, primary) when I delete an device from device table using form it is also deleted from IP table. This should work such as the IP address remains to be used in other device . How to resolve this? If I change the relation there is no more validatation that one IP address is used once. I want to "free" ip number when I remove device from database so IP number is not deleted and can be used later. How to accomplish this? In relation the cascading is turned off - no help referential ...

How clone a view
Hi, can anybody tell me, how can I clone a view with dmo or TSQL? Thanks What do you mean by "clone" a view? You want to create an exact copy of the view somewhere? If so, on the SQL side you might start by querying INFORMATION_SCHEMA.VIEWS. There's a column called VIEW_DEFINITION that has the exact DDL CREATE VIEW statement in it. "Thomas Hase" <tohasremspam@freenet.de> wrote in message news:gi8pk594sfo314dr49t3r0tjitfno15nhr@4ax.com... > Hi, > > can anybody tell me, how can I clone a view > with dmo or TSQL? > > Tha...

Cloning
Maybe not the right forum, but this is my question: If I want to clone a FAT 32 disk to a preformatted NTFS new disk. Is the cloning process then automatically going to change (re-format) the preformatted NTFS system on the target disk to FAT32, or do I have to first re-format the NTFS disk to FAT 32 before cloning? P.S. I want to keep FAT32 for some MAC/PC issues. Thanks for any advise. On Fri, 9 Apr 2010 00:13:30 +0200, Erdna wrote: > Maybe not the right forum, but this is my question: > If I want to clone a FAT 32 disk to a preformatted NTFS new disk. Is the >...

Cloning CListCtrls
I'm looking for a example on cloning a CListCtrl. That is moving one or more items from list A to list B so that the moved items are removed from the source list. The following works to add the selected items to the list. // ---------------- CString sItem; int iSel = 0; POSITION pos = m_cAvailImagesList.GetFirstSelectedItemPosition(); while( pos ) { iSel = m_cAvailImagesList.GetNextSelectedItem(pos); sItem = m_cAvailImagesList.GetItemText(iSel, 0); m_cUseImagesList.InsertItem(0, sItem); } // -------------- Thanks. You could use callba...

how to?: change which folders are searched in find related context menu
Hello, When you right click on a message and do "find all"->"related messages" or "find all"->"from user", you're basically just starting up an advanced search with some preselected options. One of the preselects is which folders outlook does the search in. How do I change this ? and/or add my own searches? (basically, i'd like to search in inbox and all subfolders) Many Thanks, Alex PS: cross posting....let me know if there's an appropriate group for this sorta question. There is not an option to extend that list. What you c...

HD cloned
I substituted my HD from a 160 GB Hitachi to a 640 GB WD, I made a disk-to disk copy by means of HDclone free edition, at the end it had resized authomatically the partitions, namely on the new HD the dimensions of the partitions are proportional to the corresponding ones on the old HD. Now on the old HD there was: C: NTFS, 110 GB+32 GB free space D: FAT32, recovery partition, 5,27 GB + 1GB free space and on the new HD I find: C: NTFS, 330 GB+241 GB free space D: FAT32, recovery partition, 5,27 GB + 18,5GB free space I checked C and by summing up the occupation of the first level ...

Cloning/imaging to external hard drive.
I am new to computers and I want to backup my hard drive and I've read a number of articles on how to do this but I'm not sure about some of this, I own a Dell Inspiron 1545 laptop, with a Vista Home Premium OS. I want to know which clone/external hard drive that would work with my laptop or an imaging/external hard drive. From what I have read cloning doesn't allow you to add files etc. to the ex. hard drive but imaging does, is that correct? -- padre ------------------------------------------------------------------------ padre's Profile: http://forums.techar...

Drawing on Device Independent Bitmaps
I'm writing a server application that should produce graphics comprised basically by lines and text strings. I found code that can read and write ..BMP files without relying of MFC windows. What I would like to know is if there are any functions that draw graphics directly on the Device Independent Bitmap. These functions may not be available in the MFC libraries, but perhaps someone has written something like that before. Thanks for your help, Miguel What benifits are you looking for by doing this vs. using the GDI functions? AliR. "MCorazao" <MCorazao@discussions.m...

CD-RW DRIVE/CD Drive Not showing up under device manager.
Hola, I have a dvd-RW drive and a regular cd drive installed on my computer. Up until a few days ago it was working fine. Now it dosen't even show up under the device manager. I ran a compelte virus scan which came up with nothing. I tried using the Microsoft auto-fix program and it failed. I followed the instructions for a reg edit of the upper and lower files and still no sucess. I'm kinda at a loss here. The drives open fine I haven't installed or removed anything major recently that I can think of. Once I put a game or any cd in it just comes back err. canno...

Cloning a window
Hello, is it possible to "clone" a window, i. e., to duplicate the window handle like it is possible with file handles? If not so - is there a different way of making a copy of the window? I'd like to use this mechanism in a copy constructor for a class containing a window class. TIA! > is it possible to "clone" a window, i. e., to duplicate the > window handle like it is possible with file handles? > If not so - is there a different way of making a copy > of the window? I'd like to use this mechanism > in a copy constructor for a class containin...

Verifone Devices
I have a customer who has a Verifone Omni 3200 device. I know the Pinpad 1000se is compatible with RMS, is this device compatible as well? Thanks RJ, Check with TPI Software. www.TPISoft.com Bill pops in here every few days. -- = "rjdavis@digpos.com" <rjdavis@digpos.com@discussions.microsoft.com> wrote in message news:5B2489B1-9AC7-41F0-94BD-D5F704AEE915@microsoft.com... >I have a customer who has a Verifone Omni 3200 device. I know the Pinpad > 1000se is compatible with RMS, is this device compatible as well? Thanks The Omni 3200 device is a stand alone (...

Clone Drive
Hi Sbs 2003 Scsi hdd 76gb partition into (by Dell) 12gb/64gb Problem Need larger, more space, on C: drive!! Would like to clone to a NEW 76gb drive ... so parttion would be 24gb/ 56gb (.. later using old drive as a data drive) The server is 5 yrs old ... more life in her yet... do not want to over spend .. but want to clone.. as c drv(12Gb) as runing out of space.... to a new drive with 24gb partition. Have done may pc's by booting into Ghost (dos) and then just cloning drive... have seen some reports on here this may not work! So looking for some ideas. 1....

Cloning FASLD
Hello, I'm working on Windows CE 5.0 and a Freescale BSP for iMX31. I want to clone public code of FASLD driver in the following directory : C:\WINCE500\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD\FASLD I have launched sysgen_capture tool and it has generated the following sources.fasld file : !if 0 Copyright (c) Microsoft Corporation. All rights reserved. !endif !if 0 Use of this source code is subject to the terms of the Microsoft end-user license agreement (EULA) under which you licensed this SOFTWARE PRODUCT. If you did not accept the terms of the EULA, you are not authoriz...

Serial legacy device KMDF driver
Hello, I need to develop a tool which allows for communication with a real-time bus system over RS-232. The system sends data telegrams in 1 milisecond intervals which need to be acknowledged by an ACK-telegram before the next data telegram can be sent. The serial interface adapter does not support PnP specification. Currently, as I am new to Windows driver development, I am looking for a starting point to dig into: either to implement a filter driver on top of serial.sys or to implement a function driver which will be enumerated by serenum.sys? The goal is to provide a...

Cloning a bitmap
On a toolbar customization dialog, I've loaded a toolbar resource into a CBitmap, and want to extract & display a single button from within it (eventually using CStatic::SetBitmap(...)). I've tried: Getting the static's DC and a compatible memDC. Creating a compatible CBitmap to the toolbar bmp. Select the toolbar bitmap into the memDC and new bmp into the staticDC. BitBlt with SRCCOPY. Release the staticDC. but it doesn't seem to work - the new CBitmap is the correct size, but all black, while the original bitmap contains a temporary GDI object of the button. Thus...

I2C device driver for intel chipset in windows 7
Dear Sir: Do we have any chance to create driver for I2C devices embedded with intel chipset in windows 7? I know the smbus in intel chipset, but I don't know how to control when connecting I2C devices in windows. Please give me any suggestion and sample code to refer Thank you! Best Regards, Alan bluestar <bluestar8783@gmail.com> wrote: > > Do we have any chance to create driver for I2C devices > embedded with intel chipset in windows 7? > > I know the smbus in intel chipset, but I don't know how ...

Device Manager Shows Up Empty i.e. Blank Then MMC Error Data Box
Running Windows XP Sp3 with all updates. After a recent boot up problem Device Manager stopped showing data, i.e. when open to view devices there is nothing there except a blank page. If left sitting for a couple minutes an error message comes up that MMC (Microsoft Management Console) has experienced an error. Is there any way to reestablish visibility in Device Manager without reloading the machine. I tried a System Restore roll back and running SFC /scannow without success. I really don't want to reload. The machine seems to be operating okay otherwise. "Docster&...

Clone of CTreeCtrl
Hello! I have some problems with CTreeCtrl. Where can I obtain the code of a CTreeCtrl clone? I tried to create a new "class MyTree : public CTreeCtrl", but it doens�t solve my problem. I need a "class MyTree : public CWnd" with the CTreeCtrl functions. Thanks Carlos I found some solutions in CodeProject.com using CTreeCtrl!! Thanks all! "Ajay Kalra" <ajaykalra@yahoo.com> escreveu na mensagem news:OUIcptYQDHA.2312@TK2MSFTNGP12.phx.gbl... > > I tried to create a new "class MyTree : public CTreeCtrl", but it doens�t > > solve my probl...

OneNote 2007 has screwed up my Outlook syncing with my PocketPC device!!!
All, Ever since I installed the beta of OneNote, when I sync up Outlook with my Pocket PC, I no longer get the notes that are attaches to any Outlook item (Task\Calender\Contacts - notes\content field)!!! Is their a way of correcting this behavior so i can get the notes contact field from my Outlook file to sync with my PocketPC. Thanks in advance. - CES are you using outlook 2003 or outlook 2007? Which active Sync version do you use? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help wi...

remove properties from IE context menu
I have an app that uses CHtmlView to create a browser for the user. I would like to modify the the right click event so that the properties option is removed, but i do not want to replace the original context menu. Thanx. See if this helps: -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "gringorott" <rott_gold@hotmail.com> wrote in message news:089601c344a0$e7f42860$a001280a@phx.gbl... > I have an app that uses CHtmlView to create a browser for > the user. I would like to modify the the right click > event so that the properties option is removed, but i do &...

How to clone an object
I have a simple object I load up from DB, Is there a easy way to clone it to a new object of the same type ? Thanks On Mon, 9 Aug 2010 19:15:55 -0400, "Phil Hunt" <aaa@aaa.com> wrote: >I have a simple object I load up from DB, Is there a easy way to clone it to >a new object of the same type ? > Probably not. <g> Depends on what you mean by "clone", ie, how much of a duplicate/copy do you need, or if you even need one? Cloning 'data' always takes you into the realm of "Shallow Copies" or "Deep Copies&q...

USB device not recognized, any port, any device
I have an Acer travelmate 4230 with Windows vista business installed. All of a sudden for no apparent reason approximately 2 days ago my PC stop recognizing ANY USB device (being the built-in cam, iPod and other USB's) that is being attached to ANY of the ports. I Checked disk for any errors and ran a full system scan for viruses and nothing came up. What can I do to fix this? -- Sincerely Kevin Kevin Baykr wrote: > I have an Acer travelmate 4230 with Windows vista business installed. > All of a sudden for no apparent reason approximately 2 days ago my PC stop >...

Clone Items
My customer has asked for a clone items function, since she is on 1.2 I implemented this as as straight SQL procedure. Items are grouped by the customer using a matrix. The customer chooses a client and then we copy all the items for that client to the new client. I copied rows from Item table and the ItemClassComponent table replacing and updating keys where neccessary. Every part of the system looks fine for the copied items but whe we attempt to purchase them the tender form fails with a multistep error message. I ran sql profiler and there are no sql statements executed after we t...