|
Programm3r wrote: 10) And never forget to thank the person you helped you
seems like he did[^]...
|
|
|
|
|
Yes... but... without reading all[^] :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
|
Hi.
I set my dialog color to black with GetStockObject( BLACK_BRUSH ); , then I put edit control with different 'BkColor'
CDC *pEditDC=m_edtInfo.GetDC();<br />
pEditDC->SetBkColor(RGB(230,251,251));<br />
pEditDC->SetTextColor(RGB(255,255,255));<br />
ReleaseDC(pEditDC);
When my dialog shows at first (before my edit control has no input string) I don't even see it (all dialog is black)! When I populate edit control m_edtInfo.SetWindowText('some text') text is displayed and edit ctrl's BkColor is shown but only behind the text not on all edit ctrl rectangle.why?
How to get all edit ctrl's region being filled with BkColour, even at first?
Thanks!
P.S.
My apology for my language.
|
|
|
|
|
Trying to set the back colour like this will not work. You need to override WM_CTLCOLOR in the dialog class to change the colours of the dialog itself and its controls.
|
|
|
|
|
Thanks for replay.
I'm already overriding that:
HBRUSH CDialList::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if( nCtlColor == CTLCOLOR_DLG )<br />
{<br />
m_myHbr = (HBRUSH) GetStockObject( BLACK_BRUSH ); <br />
}<br />
return m_myHbr;<br />
}<br />
for setting my dialog color to black!
You are saying I can put more code on it and deal with color for my edit ctrl.
Ok I put additional line code (if statement):
if( nCtlColor == CTLCOLOR_EDIT )<br />
but can you tell me what to use to set color to RGB value and not to use GetStockObject?
Thanks!
|
|
|
|
|
This is how it looks now:
<br />
HBRUSH CDialList::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if( nCtlColor == CTLCOLOR_DLG )
{<br />
m_myHbr = (HBRUSH) GetStockObject( BLACK_BRUSH ); <br />
}<br />
if( nCtlColor == CTLCOLOR_EDIT )
{<br />
CDC *pEditDC=m_edtInfo.GetDC();<br />
SetTextColor(*pEditDC,RGB(255,255,255));<br />
m_myHbr = (HBRUSH) pEditDC->SetBkColor(RGB(230,251,251));<br />
ReleaseDC(pEditDC);<br />
}<br />
return m_myHbr;<br />
}<br />
But unfortunate still doesn't work!?!
|
|
|
|
|
You shouldn't be getting a DC for the control.
Everything you need is passed to your OnCtlColor() method.
You should use the passed DC.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Easiest would be if you look into one of the controls shown in the Editcontrol-section of codeproject[^].
You will find a lot of source code to look how it is done.
Chris Losinger has made a coloring Editcontrol I use.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
You can get the whole rectangle with void CEdit::GetRect( LPRECT lpRect ) const; and insteads of set the background of the CEdit, do it with the lpRect.
Then use the CDialog::OnInitDialog (); to make your changes and...
remember to change the background of the dialog before changing/filling the edits
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
can anybody tell me what is the vc++ euivalent of the foloowing c# code
n = strXML.IndexOf("\n", n+1);
string Char = strXML.Substring(Pos, 1);
thanks in advance
Vikas da
vikas da
|
|
|
|
|
all depends which string class you're using. basic C-style strings (char*), CString, std::string, BSTR ...??
|
|
|
|
|
Thanks for reply ..
I am using BSTR type
vikas da
|
|
|
|
|
I would like to know if there is any way to quit programatically the usual "cling" when a MessageBox or an AfxMessageBox is shown.
I have taken a look to the classes in the help but I found nothing and I don't want to go to the computer sound settings, I want to do it just in my app.
Can someone give me some info?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Take a look in the registry...
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default
These are the default sounds.
Notice that other apps can substitute their own set of sounds for
system events by adding subkeys under
HKEY_CURRENT_USER\AppEvents\Schemes\Apps
Note I haven't messed with this but maybe it will help point you toward a solution
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
But oign into the registry, will be the same as doing it through the explorer... And I would like not to deactivate the sounds for the operating system. Just when im executing my app. Because when Im testing things (the error messages that the user will have when something goes wrong) the sounds nerve me. I check ALL the errors that the user can have. So... that's the reason for just a piece of code inside my app.
Anyways, thanks.
I can disable them by starting app, and enable them another time by going out the app.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: But oign into the registry, will be the same as doing it through the explorer...
Not really - you can programmatically alter the registry.
Regardless, I tried messing with this, and while my registry entries cause the sound settings
for my app to appear nicely in the "Sounds" control panel applet, the system (XP SP2) does
NOT use my settings when running the application
Please let me know if you find a solution - I will do the same
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You could always create your own message box class without too much trouble.
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
HI,
Iam involved in internationalization of my product.
Iam loading japanese resource dll for that.
I have an excel file which containg japanese strings.
while i copy the string from excel file to string table, it is not taking japanese strings ( just pasting ???????? ).
please help me about this.
|
|
|
|
|
Try setting your PC locale to japanese and then do the pasting work
Control Panel -> Regional and Language Option -> Advanced
|
|
|
|
|
iam using windows 2000 server.
i selected japanese in Regional settings.
if i type anything in string table properties entry, then it is in japanese but anything copying from my japanese excel still showing junk only.
|
|
|
|
|
And the font you are using in Excel is capable of displaying japanese characters?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
yes, in excel file iam able to see japanese strings.
|
|
|
|
|
Is there any way to determine the number of files and directories on a given volume without having to resort to the find file api's?
I'm using the FindFirst FindNext api's to iterate every file on the volume, for each file I then perform a few tasks. The whole process could take anywhere between 10 seconds and 10 minutes to complete. So I need to display the progress to the user. The trouble is I have nothing to base this progress on. If I had the total number of files before hand, I could compare this to the current and display it on a progress bar.
I'm open to suggestions here.
Waldermort
|
|
|
|
|
I have never faced with this functions, but...
is it possible to emulate the call of "properties" when a right click is made on a folder and isolate the parameter number of files / number of subfolders???
If windows can make it... we can make it, can't we?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|