Click here to Skip to main content
15,569,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to send a message Pin
Hamid_RT9-May-09 1:22
Hamid_RT9-May-09 1:22 
AnswerRe: How to send a message Pin
«_Superman_»9-May-09 5:34
professional«_Superman_»9-May-09 5:34 
QuestionWindow taskbar activation issue [modified] Pin
andrew_dk8-May-09 20:56
andrew_dk8-May-09 20:56 
AnswerRe: Window taskbar activation issue Pin
Stuart Dootson9-May-09 1:37
professionalStuart Dootson9-May-09 1:37 
QuestionHelp creating a help dialog Pin
xzing8-May-09 20:48
xzing8-May-09 20:48 
AnswerRe: Help creating a help dialog Pin
Hamid_RT9-May-09 1:15
Hamid_RT9-May-09 1:15 
AnswerRe: Help creating a help dialog Pin
Stuart Dootson9-May-09 1:22
professionalStuart Dootson9-May-09 1:22 
QuestionText with backspace in Transparent window Pin
gcorrea8-May-09 17:18
gcorrea8-May-09 17:18 
I want to know how I can write text with backspace in a transparent window.

I am using this code but it does not work.


#include <afxwin.h>


//////////////////////////////////////////////////////////////////////////
// CMyFrameWnd
class CMyFrameWnd : public CFrameWnd
{
public:
CMyFrameWnd();

protected:

CString m_Text;
//{{AFX_MSG(CMyFrameWnd)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CMyFrameWnd, CFrameWnd)
//{{AFX_MSG_MAP(CMyFrameWnd)
ON_WM_CHAR()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

CMyFrameWnd::CMyFrameWnd()
{
//Transparent window
CString strMyClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);

Create(strMyClass, _T("Frame Window"));

}

void CMyFrameWnd::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
m_Text += nChar;

if (nChar == VK_BACK)
{
m_Text = m_Text.Left(m_Text.GetLength() - 2);

TRACE("\n%s", m_Text);
}

Invalidate();
}

void CMyFrameWnd::OnPaint()
{
CPaintDC dc (this);

dc.TextOut(0,0,m_Text);
}

//////////////////////////////////////////////////////////////////////////

class CMyApp : public CWinApp
{
public:

CMyApp(){};
virtual BOOL InitInstance();

};

BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrameWnd();

m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();

return TRUE;
}


CMyApp myApp;


If I use a normal window changing:
CString strMyClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);
Create(strMyClass, _T("Frame Window"));
to
Create(NULL, _T("Frame Window"));

backspace work well

Can you give me any idea

Thanks
AnswerRe: Text with backspace in Transparent window Pin
Stuart Dootson9-May-09 1:20
professionalStuart Dootson9-May-09 1:20 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea9-May-09 6:26
gcorrea9-May-09 6:26 
GeneralRe: Text with backspace in Transparent window Pin
Stuart Dootson9-May-09 7:01
professionalStuart Dootson9-May-09 7:01 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea9-May-09 9:19
gcorrea9-May-09 9:19 
GeneralRe: Text with backspace in Transparent window Pin
Stuart Dootson9-May-09 9:30
professionalStuart Dootson9-May-09 9:30 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea9-May-09 10:58
gcorrea9-May-09 10:58 
GeneralRe: Text with backspace in Transparent window Pin
Stuart Dootson9-May-09 11:09
professionalStuart Dootson9-May-09 11:09 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea9-May-09 11:42
gcorrea9-May-09 11:42 
GeneralRe: Text with backspace in Transparent window Pin
Stuart Dootson9-May-09 11:48
professionalStuart Dootson9-May-09 11:48 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea11-May-09 14:09
gcorrea11-May-09 14:09 
GeneralRe: Text with backspace in Transparent window Pin
gcorrea20-May-09 8:29
gcorrea20-May-09 8:29 
QuestionHow To Get Cursor position in Edit Control Pin
jeansea8-May-09 17:03
jeansea8-May-09 17:03 
AnswerRe: How To Get Cursor position in Edit Control Pin
Madhu Nair8-May-09 17:31
Madhu Nair8-May-09 17:31 
Questionipod program Pin
john3468-May-09 13:55
john3468-May-09 13:55 
AnswerRe: ipod program Pin
Electron Shepherd8-May-09 14:46
Electron Shepherd8-May-09 14:46 
AnswerRe: ipod program Pin
bulg8-May-09 17:37
bulg8-May-09 17:37 
QuestionDuplex pipes Pin
HungryHorace8-May-09 13:03
HungryHorace8-May-09 13:03 

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.