|
hi prasad,
when i choose the color from the Color Dialog that Color Must be Reflect to the EditBox.
I mean when i Created the EditBox in LButtonEvent. Then i Right Click on the EditBox then a Popup Menu is being populated. then select the first MenuItem to Display the ColorDialogBox.
In that we choose the Color and store it in COLORREF. In our Instance it variable c.
That variable Color Must Reflected in the EditBox BackGround Color.
Uday kiran
-- modified at 8:28 Thursday 24th August, 2006
|
|
|
|
|
you need to return brush of that color in OnCtlColor
|
|
|
|
|
hi prasad,
That also i have done please look at my First Post.
thanks
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: That also i have done please look at my First Post
I reallize that.I modified my post,too. It's always better to use pre tags for code. It makes code readable. I just missed it, on this occasion.
You code in OnCtlColor could be like this,
HBRUSH CExpDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch (nCtlColor)
{
case CTLCOLOR_EDIT:
{
hbr=CreateSolidBrush(c);
return hbr;
}
}
return hbr;
}
-- modified at 8:41 Thursday 24th August, 2006
-- modified at 8:51 Thursday 24th August, 2006
|
|
|
|
|
Hi prasad,
even i modified the code after set focus to the newly created editbox the effect is being shown.
please loot at it.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch (nCtlColor)
{
case CTLCOLOR_EDIT:
{
m_redbrush.DeleteObject();
m_redbrush.CreateSolidBrush(c);
pDC->SetBkColor(c);
hbr = (HBRUSH) m_redbrush;
}
}
return hbr;
}
Uday kiran
-- modified at 9:15 Thursday 24th August, 2006
|
|
|
|
|
uday kiran janaswamy wrote: after set focus to the newly created editbox the effect is being shown
what do you mean by this? Can you be more clear. If you mean , it doesn't immediately paint, then you need to call Invalidate , on CEdit class.
uday kiran janaswamy wrote: pDC->SetBkColor(c);
You need not call this.
-- modified at 9:43 Thursday 24th August, 2006
|
|
|
|
|
hi prasad,
You are correct i forgot to call the ::Invalidate(...) method to reflect the Immediate Changes.
Uday kiran
|
|
|
|
|
|
When we mount two paritions of a USB drive (HDD) such that Drive A: is mounted in a folder of drive B: and Dirve B: is mounted in a folder of Drive A: i.e. create recursive mount points. Thus the mounted points (folders in which drive are mounted) have current GUIDs of the partitions of USB drive. If user plug off this USB drive and plug on to another system. Thus the system will assign new GUIDs to USB drive partitions. But the mounted points previously created have olders GUIDs i.e. the one that was assigned to these folders when the mount points were created (NOTE: we get these GUIDs using DeviceIoControl). So, when we pass these GUIDs as path to the CreateFile method, it fails because new GUIDs are assigned to the partitions. But these GUIDs are valid if we pass as path in CFileFind.
So, what is actually happening in these cases i.e. for CreateFile and CFileFind ?
How these mount points (created on USB drive) be valid on the other system ? Although these mounts are valid if we access through windows explorer.
|
|
|
|
|
Hello!
Anybody knows how to make EditBox to accept only bitwise strings (0 and 1), something like ES_NUMBER that allows only digits to be entered into the Edit Control.
SzyKam.
|
|
|
|
|
I don't know such a control but you can do one yourself quite easily: create a new class (CBitwisEdit for example) that inherits from the CEditCtrl. Override the OnChar function. Inside this function, check if the char entered is either '0' or '1'. If this is the case, call CEditCtrl::OnChar, otherwise don't call it.
|
|
|
|
|
hi,
In order to Accept Numeric Values in the EditControl, You have to SubClass the EditControl by Creating a new CEdit Class and specify the Messages.
In our Instance WM_CHAR. in the WM_Char Message check for the Only Numeric Variable.
Think Clever.
Uday kiran
|
|
|
|
|
Hi Friends,
We are developing an application which will start when the computer starts and the system will shutdown when the application is closed.
I want to hide the windows 'start' menu so that user can not access any other soft wares from the system apart from our application.
Can any one pls suggest any function and how to hide the start menu on the start up
Thanks in Advance,
Dinesh
|
|
|
|
|
switch to another desktop...
|
|
|
|
|
It seems you need to
<br />
<br />
FindWindowEx(FindWindow("Shell_TrayWnd", NULL)->m_hWnd, <br />
0, "Button", NULL)->ShowWindow(0);<br />
<br />
FindWindowEx(FindWindow("Shell_TrayWnd", NULL)->m_hWnd, <br />
0, "Button", NULL)->ShowWindow(1);<br />
<br />
<br />
|
|
|
|
|
do you think seriously (even if it does work for hiding the start button) that it will prevent, as the OP wants, to users to launch applications ?
the windows+R keyboard combination allow the user to reach the "Run..." dialog, Windows+E keys, to launch the explorer...
i don't think this "security reason" should be solved like this...
|
|
|
|
|
WhiteSky wrote: FindWindowEx(FindWindow("Shell_TrayWnd", NULL)->m_hWnd,
0, "Button", NULL)->ShowWindow(0);
FindWindowEx(FindWindow("Shell_TrayWnd", NULL)->m_hWnd,
0, "Button", NULL)->ShowWindow(1);
your Window will hung after some time !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
It has a mistake/**/ and FindWindowEx(..... was a code and you can use from CWnd.Did you get my mail!?
|
|
|
|
|
|
Hello,
I am having a dialog-based MFC application, in which I have placed a RichEdit control, and I want to trap the F9 key, which I am not able to do. Please help.
Software Developer
Sanjay Khapre
|
|
|
|
|
I am Developing an application for Windows Mobile,Using VS2005 and SQLite Database.
I am facing two problems.
1.Database is always cleared every time I am reloading the application.
2.I cannot bind the data to the List View as Columns, I can bind only one column.
Please Anybody help me
|
|
|
|
|
Sri harini wrote: 1.Database is always cleared every time I am reloading the application.
This seems to sqlite configuration problem.. please check the api called to operate the SQLite DB in your program!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I made an application which used a dll and loads it dynamically. If dll is not present an exception raises. All i want is if dll is not present it should be known at the Loadlibrary(..) call and i could handle that exception. I have specified lib fiel of that dll in the tools->project settings->link tab. Is there any other way?
Thank you
KIRAN PINJARLA
|
|
|
|
|
LoadLibrary() returns NULL if it can't load the DLL. If you're getting an exception, I bet you're not checking the return value from LoadLibrary() and blindly using it.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote: I bet you're not checking the return value from LoadLibrary() and blindly using it.
U lost.
I am checking the return value. Here is my code.
if((h = LoadLibrary("..\\Output\\DllOne.dll")) == NULL)<br />
{<br />
AfxMessageBox("Failed To Load Library");<br />
return;<br />
}<br />
COne one;<br />
one.ShowMsg();<br />
FreeLibrary(h);
Let me explaint what is happening exactly. My client application is a dialog based app. I wrote the above code in a button press. It should load and return value when button is presse.
But the problem is even the dialog is not being displayed. Even before that its showing the exception
"THE APPLICATION FAILED TO START SINCE ATHE one.dll IS NOT FOUND. REINSTALLING THE APPLICATION MAY FIX THE PROBLEM"
right after executing x.exe file.
Can u help me now?
KIRAN PINJARLA
|
|
|
|