transparent window after bringWindowToTop is grey

Hallo,

I have a problem with a transparent window.

My message windows are simple CWnd-Windows, whitch are hide.

Only,
if I want to see the window,
I bring them into front with
'bringWindowToTop()'.

Problem:
I want to give the window a transparent border
( later I want to display a transparent bitmap ).

So  I have a
- CtrlColor-Func
  it returns NULLBRUSH

- OnEraseBkgnd-Func
  first I paint the full area with NULLBRUSH
        FillRect(..)
  then I reduce the Rect
       r.left += 20
       r.right -= 20
   and fill the small area with a color.

- No OnPaint-Func

But the window is grey.

I have already solutions with transparent Buttons and MarqueeText.
But I hope, only to display a window with transparent background is a
little bit easier.

--
Thanks
Frank Iversen


0
fiversen (47)
5/2/2008 2:41:20 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
365 Views

Similar Articles

[PageSpeed] 29

"fiversen" <fiversen@wedding.in-berlin.de> wrote in message 
news:5dbfc1ef-7c4c-48b5-b970-7f229b7f270d@c65g2000hsa.googlegroups.com...
> Hallo,
>
> I have a problem with a transparent window.
>
> My message windows are simple CWnd-Windows, whitch are hide.
>
> Only,
> if I want to see the window,
> I bring them into front with
> 'bringWindowToTop()'.
>
> Problem:
> I want to give the window a transparent border
> ( later I want to display a transparent bitmap ).
>
> So  I have a
> - CtrlColor-Func
>  it returns NULLBRUSH
>
> - OnEraseBkgnd-Func
>  first I paint the full area with NULLBRUSH
>        FillRect(..)
>  then I reduce the Rect
>       r.left += 20
>       r.right -= 20
>   and fill the small area with a color.
>
> - No OnPaint-Func
>
> But the window is grey.
>
> I have already solutions with transparent Buttons and MarqueeText.
> But I hope, only to display a window with transparent background is a
> little bit easier.
>

If this is not a child window, then for transparency, I would make it a 
WS_EX_LAYERED_WINDOW.  Only with layered windows and Windows regions can you 
truly achieve transparency.

Painting with a null brush has no effect at all.  As for why the window is 
gray, are you by chance calling the inherited OnEraseBkgnd()?

-- David


0
dc2983 (3206)
5/2/2008 9:25:58 PM
Hello David,

> > I have a problem with a transparent window.
> >
> > Problem:
> > I want to give the window a transparent border
> > ( later I want to display a transparent bitmap ).


> If this is not a child window, then for transparency, I would make it a
> WS_EX_LAYERED_WINDOW.  Only with layered windows and Windows regions can you
> truly achieve transparency.
>
> Painting with a null brush has no effect at all.  As for why the window is
> gray, are you by chance calling the inherited OnEraseBkgnd()?

So,
to make a window transparent is a complicate thing to do !

In my
- CStatic, with CtlColor, NULLBRUSH .. I was successfull
- CButton, I need a background-bitmap
- CMarqueeText, I need a background-bitmap

I try
- CWnd, with a background-bitmap

WS_EX_LAYERED I cannot use, because the programms runs also on WinNT
computer.

Thanks.
---
Frank Iversen
0
fiversen (47)
5/5/2008 7:53:23 AM
"fiversen" <fiversen@wedding.in-berlin.de> wrote in message 
news:9dc5535a-3ec2-45c4-8299-5eb287f0b953@k13g2000hse.googlegroups.com...
> So,
> to make a window transparent is a complicate thing to do !
>
> In my
> - CStatic, with CtlColor, NULLBRUSH .. I was successfull
> - CButton, I need a background-bitmap
> - CMarqueeText, I need a background-bitmap
>
> I try
> - CWnd, with a background-bitmap
>
> WS_EX_LAYERED I cannot use, because the programms runs also on WinNT
> computer.
>

Oh, these kind of windows are typically WS_CHILD windows, so you don't use 
WS_EX_LAYERED with these anyway.  With CButton, I would override 
WM_ERASEBKGND and draw the bitmap.  Same with CMarqueeText.

-- David


0
dc2983 (3206)
5/5/2008 2:34:02 PM
Reply:

Similar Artilces:

Windows mail problem 07-16-10
Tried to log into my optonline account and received the following message: The connection to the server has failed. Account: 'mail.optonline.net', Server: 'mail.optonline.net', Protocol: POP3, Port: 995, Secure(SSL): Yes, Socket Error: 10060, Error Number: 0x800CCC0E Can anyone decipher this for me? What is the issue? You should not be using advanced ports or SSL, see http://optimum.custhelp.com/cgi-bin/optimum.cfg/php/enduser/std_adp.php?p_faqid=2397&p_created=1237397986&p_sid=ZbGnw*4k&p_accessibility=0&p_redirect=&p_lva=&p_sp=cF9zcmNoPSZ...

Find/Replace command in Windows Live Mail
Does anyone know if the Find/Replace command is available in Live Mail. I cannot find it. If not, does anyone know of a suitable solution for that "will be missed" command. No, it's not. If you need to use Find/Replace, select all the text and 'cut' it. Then paste into Notepad where you can do the Find/Replace. When done, paste the result back into your email message. Gary VanderMolen, Microsoft MVP (Mail) "LouiseL" wrote in message news:8C2EDC90-74F5-4D16-948F-461EACB0F3C3@microsoft.com... Does anyone know if the Find/Replace command is ava...

windows/system32/config/system file is huge
Hi, My windows/system32/config/system file is huge -- the order of 200mb. This seems a bit unusual, and I did get some popups on startup that there is not enough room for the registry. I cleared out the paging file and reallocated 1.5*2gb (the size of my memory). Anyway, what can I do about this file to make it "normal" again? I will state that I am after a repair install because something happened to my system and I needed to repair. Now things are indeed working alot better, but there is still this issue, and I guess this is why my system works slowly at times a...

Windows 2000 server user names
Where can I configure the user names formatting like you do in Recipient policies? yaro ...

Windows installer problem 04-08-10
Hi All, After login to windows xp, on screen displayed windows installer and nothing showing on screen .Any reply will be appreciated. Best regards Anji Always state your full Windows version (e.g., WinXP SP3; WinXP 64-bit SP2) when posting in a forum or newsgroup. Please do so in your next reply. Was the computer fully patched at Windows Update when this problem started? What anti-virus application or security suite is installed and is your subscription current? What anti-spyware applications (other than Defender)? What third-party firewall (if any)? Has a(another)...

Rules window disappears in less than 1 second
I just installed Outlook 2003 and now when I click on Rules the Rules dialog ox pops up for less that 1 second and then disappears not allowing any entry into it for editing and or setting up a rule. Any Ideas? ...

Regsitry Key inaccessable in Windows 2003
Hi all, I cannt access a Registry Entry from windows 2003. Works fine with Windows 2000. I am accesing it from a Service in vc++. If i change the service Run as to Administrative Account it works, but fails in local account. No problem at all in Windows 2000. Any Clues??? Thanks and Regards, Abhinav Have you checked if you have the correct permissions to access that key using a local account on the 2003 box? - MR "Abhi" <bhagwatav@hotmail.com> wrote in message news:u0cjdDP4EHA.2608@TK2MSFTNGP10.phx.gbl... > Hi all, > > I cannt access a Registry Entry from win...

A question on __declspec(dllimport) and the Windows APIs.
In chapter 19 of Jeff's classic book "Programming Applications for Microsoft Windows", there is a paragraph as follows: "What Importing Really Means The previous section introduced the _ _declspec(dllimport) modifier. When you import a symbol, you do not have to use the _ _declspec(dllimport) keyword-you can simply use the standard C extern keyword. However, the compiler can produce slightly more efficient code if it knows ahead of time that the symbol you are referencing will be imported from a DLL's .lib file. So I highly recommend that you use the _ _declspec(dllimp...

greyed out close button
I have Excel 2002 and cannot figure out why the close button is greye out. Can anyone tell me how to active this button. thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com I have a greyed out close button and a co-worker has a greyed out minimize button. If you find out what to do please let me know. Thanks >-----Original Message----- > >I have Excel 2002 and cannot figure out why the close button is greyed >out. Can anyone tell me how to active this...

windows mail- vista, error with downloading attachments
When i click on the attachment it asks for my approval and then i click open. Then an error appears which at the frame of the window(above) says C:/Users...temporaryinternetfiles... ,and below an X with a message saying: This file does not have a program associated with it for performing this action. Create an association in the set associations control panel . What do i have to do? Regards, Antonis You have to, "Create an association in the set associations control panel." Go to Start - Default Programs - "Associate a File Type or Protocol with a Program&q...

Problem with Static splitter window...
Hi, Iam trying to create splitter windows. I need my window to be split into two rows. And then, each of the two rows must be further split into 2 columns. I need it precisely like this because I need the splitter bar in both rows to be separate and independent. Can somebody help me find what's the problem in the following code? It does not create the lower splitter. Any help will be greatly appreciated. Thanks, Shirley BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { int nWidth, nHeight; nWidth = ::GetSystemMetrics(SM_CXMAXIMIZED); nHei...

Business Portal - Employee Pay
This window does not auto-populated from existing employee data in Business Portal HRM:SS. The Employee Profile/Dependent/Benefits etc. windows all populate immediately but the W-4 window requires that a Modify transaction be made by the employee and approved by the supervisor before it will display data. This is contrary to all other windows and confuses the employees. It provides a first-impression that is not good for their experience with Business Portal. Mike Lupro -- Mike Lupro ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestion...

align left and align right buttons greyed out
command buttons for left align and right align are permanently greyed out. Default for new docs is left align so not much problem but there is no way to right align. I am using Word 2007. Any ideas? ...

How to set Excel to open a new window for each application
When I choose a spreadsheet to open, I want it to open a new window. This used to happen but now opens in the same instance, just hiding my original spreadsheet. How to I get it back to previous settings? Tools-->Options, View tab. Check Windows in Taskbar. ************ Anne Troy www.OfficeArticles.com "Luke" <Luke@discussions.microsoft.com> wrote in message news:052E3C3A-8A1A-4EB4-BE2D-B6E09D4D247F@microsoft.com... > When I choose a spreadsheet to open, I want it to open a new window. This > used to happen but now opens in the same instance, just hiding my ori...

Windows 7 stuck in "Preparing to Hibernate"
How do I override "Preparing to Hibernate" or "Preparing to Shutdown" ? It's been in this mode for over six hours. Nothing removes the blue screen w/these words. Nothing to do with Word, but just keep the on/off switch pressed. -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professional basis. "lsmo64081" <lsmo64081@discussions.microsoft.com> wrote in message news:61669E75-5C16-4D1B-B69A-89F293C9B0FF@microsoft.com... > How do I override "P...

Drawing the iconic window
Many years ago, it was possible to draw anything you wanted in the iconic window view. Today, it seems like the SHell has taken this over completely. I've got two problems: My app has no caption bar and no system menu, but I want to handle right-click on the taskbar icon. No messages appear to be generated to indicate any activity in the task bar icon. My app would like to custom-draw the iconic representation on the taskbar, such as drawing the icon and the caption. It does not appear this is possible. Note that the funny routine that MFC generates for dialog-based apps, that is suppose...

Windows Live mail takes much longer than ISP
My email service is through Sky.com and hotmail but Windows Live does not display mail for sometime an hour after it is in Sky mail. Why is this happening. It was not a problem in Outlook Express. What is you setting under Tools/Options... General tab... Send/Receive messages... Check for new messages every "xx" minutes... reset "xx" to "10" (default = 30). If you needs something quicker, you can manually sync. "Bryan1345" <Bryan1345@discussions.microsoft.com> wrote in message news:864941E6-EA56-434F-8DB0-5F3F2EF3AA4C@microsoft.com...

After I install a software in windows xp , how many changes have h
After I install a software in windows xp , how many changes have happen in registry? Because I need to read the value of registry ,please tell me all the changes in registry. I appreciate your help. -- jake After you install "a piece of software" in Windows, some number of registry keys, dependent entirely on whatever the person writing the installation decided should be modified, have been modified. In addition, once you run it, some other keys, defined by the person who coded it, and based on whatever actions the user has taken, will be changed. Each piece of software is ...

Restore Backup from Outlook 2003 into Windows 7(64)
Old laptop running XP; did backup of Outlook 2003 pst files using microsoft personal folders backup tool, to ext. hard drive. Connected hard drive to new laptop running Win 7(64). How do i restore the bu? All attempts met with error message saying I do not have authorization to access the file. Then tried to export the pst files from old laptop to ext hard drive. Connected hard drive to new laptop and tried to import the exported files into Outlook 2003. Got a similar message saying I did not have permission to access the selected files. Please help Bill. Submitted using http:/...

Using Windows Mail in Windows &
I have been using Windows Mail (copied from Vista) in my Windows 7 computer for nearly 6 months without any problems. Now, since Windows update KB978542 was installed a couple of days ago it has stopped working. It appears as a running program in Windows Task manager but the user interface never appears. I have done a System Restore to before KB978542 and Windows Mail started working OK again, Repeated this three time so I have no doubt that it is KB978542 that has buggered it up. Has anyone else using Windows Mail in Windows 7 had this experience? Are MS purposely disabli...

See this correction patch for Microsoft Windows
--hanoxjmvugy Content-Type: multipart/related; boundary="geygsediuj"; type="multipart/alternative" --geygsediuj Content-Type: multipart/alternative; boundary="orxbebvyw" --orxbebvyw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three new vulnerabilities. Install now to protect your computer. This ...

Windows defrag on exchange partition.
Hello, I am running win 2003 with exchange 2003. Is it safe and/or worthwhile doing a defrag on the partition that the exchange databases are located? thanks in advance... In my experence with 2k3, i havnt had any probelms. supprisingly but no real problems. i think its because (on my test box now) i have everything on one 40 gig logical drive (c:) with no RAID. Now, note: RAID may not play nice, i wouldnt try it on RAID until someone else who has done it says so... enjoy... Anthony "Simon" wrote: > Hello, > I am running win 2003 with exchange 2003. Is it safe and...

Problems with windows
I just got my computer cleaned up and downloaded some programs without having adobe back on and a window appeared and said "Windows cannot open this and gave yes and no options." I clicked "No." And a window opened and I moved it to Word and I can't open anything on windows any more. This comes up and I sure would like some wisdom on what to do. File Conversion: Select the encoding that makes your document readable Text encoding Windows default has a circle with a period in the center MS-DOS other en...

internet explorer mime type resubmit to window error
I have an web-app that can produce a receipt by submiting a html table into a new window and setting the mime type to Excel. This functionality works fine. If the user does not close this window and goes to create a new receipt then the excel plugin within explorer simply copies the data within the previous window into the new window and ignores the new data. Is there any solution to this problem? First, I don't know what I'm talking about. Second, it does sound like some kind of caching problem. Is there anyway you can force the web application to refresh the cached data? ...

The options turn to grey when I open excel files at IE
If I use another PC. It's no problem. I use Office XP. Thank you very much! My first guess is that opening excel files inside might be the problem. But I just tried it (xl2002, MSIE 6.0, and win98), and the Options were ok (except for one--statusbar). So.... What options are you writing about? And if you are opening within MSIE, you may want to stop that behavior and just open in excel. >From a previous post: There's a setting in Windows that you can change. In win98, I can do this: Start Windows Explorer View|Folder Options File Types Tab scroll down to MS Excel Workshee...