how to create transparent dialog but image or text drawn on it is visible in MFC. I searched many articles but didn't get exactly what i want. I want to deploy this in my project. help can be appreciated please help.
相关问题
- Create CFrameWnd gives first-chance exceptions--wh
- Underline is drawn outside of rectangle reported b
- Bold labels in MFC
- Why is my MFC application hanging after interactin
- Sort files according to creation date?
相关文章
- MFC CListView响应HDN_ITEMCHANGING后改变列宽无法自动显示隐藏水平滚动条
- How can I handle the Return key in a CEdit control
- How can I create a guid in MFC
- Visual Studio unable to recognise my MFC library f
- How to get WM_POWERBROADCAST message in CWinApp?
- How to remove memory leaks between OpenCV 1.1 and
- Sending the message Ctrl+Alt+Del from my applicati
- How to display Red Squiggly Lines in CRichEditCtrl
In OnInitDialog you put this:
RGB(255,0,255)
is the COLORREF for magenta. We suppose here that you don't use the color magenta anywhere in your dialog. With that all magenta pixels of your dialog will be transparent. As you want only the background to be transparent, we will paint the background of the dialog in magenta. This is done via the WM_ERASEBKGND message:In the message map of your dialog add
ON_WM_ERASEBKGND()
, so your message map should look like this :In the header file of your dialog you should have
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
In the .cpp file of your dialog put this :