|
|
Programm3r wrote: kakan, thank you very much for your help ...
if you can use ISensNetwork, that will provide you accurate detail!
|
|
|
|
|
Hi,
When i change the background color of my dialog, along with that the color of the edit box in my dialog is changing.. but i want the editbox color to be white only..
Is there anyway to do?
Is there any function like in the case of listcontrol(SetBkColor()) to get the color of Editbox to the color i want to.
Harsha
|
|
|
|
|
harsh_2961 wrote: When i change the background color of my dialog, along with that the color of the edit box in my dialog is changing.
How you have done this ?
|
|
|
|
|
I put the code in my reply just now.. please see the code..
Harsha
|
|
|
|
|
harsh_2961 wrote: please see the code
Where ? I cannot see it .
|
|
|
|
|
I used following function
HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_brush;
}
along with the line m_List.SetBkColor(RGB(255, 255, 255));
in oninitdialog().
Harsha
|
|
|
|
|
I'm not sure, how you have done it, but modify your code to,
CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_brush;
}</blockquote>
To skip edit control painting do this,
HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
m_brush= CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor == CTLCOLOR_EDIT)
{
return brush
}
else
{
}
return m_brush;
}
|
|
|
|
|
harsh_2961 wrote: When i change the background color of my dialog, along with that the color of the edit box in my dialog is changing..
can u show the code...
Do your Duty and Don't expect the Result
|
|
|
|
|
I used following function
HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_brush;
}
along with the line m_List.SetBkColor(RGB(255, 255, 255));
in oninitdialog().
harsha
|
|
|
|
|
harsh_2961 wrote: along with the line m_List.SetBkColor(RGB(255, 255, 255));
in oninitdialog().
Hope the m_List is your CEdit control.
harsh_2961 wrote: HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_brush;
}
Instead of simply returning m_brush(hope this the brush to paint the dialog background). Try this,
CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (CTLCOLOR_EDIT != nCtlColor)
return m_brush;
return hbr;
}
The above change the background color for all the controls in the dialog except for the CEdit controls.
If you want to change the color only to the dialog then change the 'if' condition as below
if (CTLCOLOR_DLG == nCtlColor)
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks a lot ... its perfectly working
Harsha
|
|
|
|
|
Default color of editbox is white but if you want to change color of editbox use of WM_CTLCOLOREDIT
|
|
|
|
|
Over ride WM_ERASEBKGND and put this code over there.
CPen myPen;
int i =100;
CRect rect ;
myPen.CreatePen(PS_SOLID, 1, RGB ((i * 4),0,0));
CPen *oldPen = pDC->SelectObject(&myPen) ;
GetClientRect(&rect);
for(i = 0 ; i <= rect.bottom;)
{
pDC->MoveTo(0, i);
pDC->LineTo(rect.right, i);
pDC->SelectObject (&myPen);
}
pDC->SelectObject(oldPen) ;
return TRUE ;
The edit box would not be painted to match the dialog back color and would show as white. See if this helps
_AnShUmAn_
-- modified at 4:55 Wednesday 14th March, 2007
|
|
|
|
|
harsh_2961 wrote: When i change the background color of my dialog, along with that the color of the edit box in my dialog is changing.. but i want the editbox color to be white only..
HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH OrgBrush=CreateSolidBrush(RGB(255,255,255)); // make it white
if(pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT1)->GetSafeHwnd())
{
return OrgBrush;
}
return m_brush;
}
|
|
|
|
|
ThatsAlok wrote: if(pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT1)->GetSafeHwnd())
if (pWnd->GetDlgCtrlID() == IDC_EDIT1) would be better.
|
|
|
|
|
I am working on email program in VC++. Thru my application I can send mails now. But i want to give user login and password fecility to that.
Here the condition is
<BR>->I want to check the given Mail-id(UserID) & password are correct or not.<br />
->For example User id = "abc@gmail.com"<br />
->respective gmail password = "hello"<BR>
If user entered these two details to my application i need to check the mail id is valid or not and whether password is correct or not. How i can do this.
Could any one please help me in this.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Could any one help me.
Atleast i need idea. Please.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Hi Every one.
I need authentication details. Could any one please kindly helpme in this.
What is authentication, and how to check this authentication. How to use SSL concept in the Email sending program. please help me. this is urgent for me.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Does CString allocate memory on the heap or on the stack?
<br />
#include "stdafx.h"<br />
<br />
#include <afxwin.h>
#include <afxext.h>
#include <afxtempl.h><br />
<br />
#include "TestCString.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
CWinApp theApp;<br />
<br />
using namespace std;<br />
<br />
<br />
void SomeFunc(CList<CString, CString> &oList) {<br />
CString strOriginal = L"ABCDEF";<br />
CString strNewString; << Local variable declared on Stack but seems like it allocates on heap since it can be called from "Main".<br />
<br />
strNewString = strOriginal.Mid(2);<br />
oList.AddTail(strNewString);<br />
<br />
return;<br />
}<br />
<br />
<br />
<br />
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])<br />
{<br />
int nRetCode = 0;<br />
<br />
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))<br />
{<br />
cerr << _T("Fatal Error: MFC initialization failed") << endl;<br />
nRetCode = 1;<br />
}<br />
else<br />
{<br />
CList<CString, CString> oList;<br />
CString strString;<br />
<br />
SomeFunc(oList);<br />
strString = (CString) oList.GetHead();<br />
<br />
printf("%s", strString);<br />
}<br />
<br />
return nRetCode;<br />
}<br />
|
|
|
|
|
The memory for the character array is on the heap.
|
|
|
|
|
devvvy wrote: Does CString allocate memory on the heap or on the stack
CString uses heap to create char array.
devvvy wrote: CString strNewString; << Local variable declared on Stack but seems like it allocates on heap since it can be called from "Main".
strNewString = strOriginal.Mid(2);
oList.AddTail(strNewString);
Actually, CString class uses class CStringData , which keeps tack of this buffer using reference counting.
In this case AddTail cause to increase refernce count by 1, thats why buffer contained in strNewString will not be destroyed even though object goes out of scope.
|
|
|
|
|
i am having a tab with two items. when i click cancel from one item the dialog with tab has to be closed. how to do this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: when i click cancel from one item the dialog with tab has to be closed
Send custom message to dialog, which has the tab. Handle the message in the dialog and close it as you like (say OnOK or OnCancel or EndDialog ...)
or
If the dialog is the parent winodw for the tab then simply call
GetParent()->EndDialog(..);
Hope i understood your question..
Do your Duty and Don't expect the Result
|
|
|
|
|
how to control the tab dialog from parent dialog? i want to call a function declared in tabdialog from the parent parent dialog
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|