|
you need to WM_CTLCOLOREDIT message
whitesky
|
|
|
|
|
See the following answer posted in the same page...
Here[^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
yogendra kaushik wrote: i want to change color of a particular control
I think following code will solve ur problem
if(pWnd->GetDlgCtrlID()==IDC_EDIT1)<br />
{<br />
CRect rect;<br />
pWnd->GetClientRect(&rect);<br />
pDC->FillSolidRect(&rect,RGB(255,0,0));<br />
pWnd->ReleaseDC(pDC); <br />
}<br />
put this code in OnCtlColor ().
This wil give you desired output.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
thanks a lot
mut if i want to change color of many edit boxes then i had to use if statement for each or there is some other techniqe to sole it plz send me code
Please mail me
|
|
|
|
|
send me as early as possible
#sankar#
|
|
|
|
|
try EnumChildWindows.
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
|
Use FindWindow() or
use CWnd* GetDlgItem(int nID)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 5:33 Monday 19th June, 2006
|
|
|
|
|
sankarRao wrote: How we can get the handle of child window
See the following API in case of Dialog's Child window
HWND GetDlgItem( HWND hDlg, int nIDDlgItem);
what do you mean send me as early as possible ?? is this you description of your question.. please ...we are not here for providing full solutions but suggestions....we are also developers like you.
Knock out 't' from can't,
You can if you think you can
-- modified at 5:44 Monday 19th June, 2006
|
|
|
|
|
A_Laxman...we are also developers like you.
Speak for yourself.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I am unable to find any sample code covering the change of color in text output. I would be grasteful for any pointers.
Raymond Mercier
|
|
|
|
|
I'm not sure if this is what you are asking but theForger has a nice win32 API tutorial. It can be found here:
http://www.winprog.org/tutorial/dlgfaq.html
|
|
|
|
|
RaymondM wrote: I am unable to find any sample code covering the change of color in text output. I would be grasteful for any pointers.
See the Following link.
Here[^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Try this out (If possible use reflect message in yours )
HBRUSH CMessaJunkDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
if (nCtlColor==CTLCOLOR_EDIT )<br />
pDC->SetTextColor (RGB(255,0,0));<br />
return hbr;<br />
}
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
Thanks to the three people who replied so promptly. Of course SetTextColor and the messages like WM_CTLCOLORDLG are the obvious thing, but somehow I had never had to do it before.
Raymond Mercier
|
|
|
|
|
in OnPaint function test this code
<br />
CPaintDC dc(this);
dc.SetTextColor(RGB(0,0,200));<br />
dc.TextOutW(10,10,_T("test"),4);<br />
whitesky
|
|
|
|
|
Experts!
I have a device conected to my computer with a USB,
i want to stop this device and then start it again.
i selected disable in the device manager and the device was disable successfully.
But when i tried to do it programmaticatly it failed.
I tried calling "net stop service_name_blabla" from the command line.
and i tried using SERVICE_CONTROL_STOP,in ControlService
but they both failed, reason:
"The requested control is not valid for this service. " error
how can i disable the service with C++ like i'm doing well in the device manager ?
thanks.
|
|
|
|
|
BabyGuru wrote: a device conected to my computer with a USB
BabyGuru wrote: how can i disable the service with C++ like i'm doing well in the device manager ?
Use SetupDiSetClassInstallParams function to do this.
Maxwell Chen
|
|
|
|
|
Is it possible to use iTunes SDK without installing itunes? Can I use APIs provided by iTunes SDK just by registering the required DLLs and with required files? Please send me some links where I can find sample applications to update iPod(sync) thru our own application which uses iTunes SDK.
Vignesh T R
|
|
|
|
|
Halid Niyaz wrote: Is it possible to use iTunes SDK without installing itunes? Can I use APIs provided by iTunes SDK just by registering the required DLLs and with required files? Please send me some links where I can find sample applications to update iPod(sync) thru our own application which uses iTunes SDK.
See the Following link where you get example.
Here[^]
If the Dll uses the Libraries then you have to link that library else it throws linker error.
Knock out 't' from can't,
You can if you think you can
-- modified at 5:01 Monday 19th June, 2006
|
|
|
|
|
how to use connect command in mfc . what are the paramaeters which is to be passed to connect to host.
prashant jain
-- modified at 4:53 Monday 19th June, 2006
|
|
|
|
|
From the docs :
int connect (
SOCKET s,
const struct sockaddr FAR* name,
int namelen
);
s
[in] A descriptor identifying an unconnected socket.
name
[in] The name of the socket to connect to.
namelen
[in] The length of the name parameter.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Here have a look at this!
http://msdn2.microsoft.com/en-us/dxt965kz.aspx
Robbie
|
|
|
|
|
Hi guys,
I have a function where I am passing a value by reference. Below is the prototype:
bool retrieveLogFileLocation(LPSTR&);
Now within the body of the function definition I have the following function as well.
bool retrieveLogFileLocation(LPSTR& value){
char[255] lszValue;
HKEY hKey;
LONG returnStatus;
DWORD dwType = REG_SZ;
DWORD dwSize =255;
bool success = true;
RegQueryValueEx(hKey, "InstallationPath", NULL, &dwType, (LPBYTE)&lszValue, &dwSize);
strcpy(value, lszValue);
}
The problem I am receiving is that whenever my program runs, it crashes instantly, and I know for sure it is an issue with strcpy(value, lszValue) . I have tried in multiple ways through type-casting and such to resolve the issue, but I'm perplexed as to whats causing the problem.
Any help would be appreciated
Robbie
-- modified at 4:53 Monday 19th June, 2006
PS: I only included bits and pieces of the function definition simply because the actual function definition is very long. :P
|
|
|
|