|
selected text???
Well you can handle WM_CTLCOLOREDIT which will change the color of all your text and background inside the edit, which I think might change your selection color (if selection is drawn using an XOR)
Actually I think those colors are stored in GetSysColor() so I think your out of luck without resorting to subclassing it's WM_PAINT message...however be forewarned...from personal experience...WM_PAINT is not the only place edit controls draw from...atleast it seemed to me
They paint inside WM_CHAR and everything...it's really quite annoying...
p.s-You could maybe intercept the selection of an edit control (using a hi-res timer to repeat check if selection has changed and if it has) change the global settings of foregroudn and text selection colors. This should work because only a single control can have focus at any given time...then when your done with the control return colors back to default.
Cheers
How do I print my voice mail?
|
|
|
|
|
emmm... it looks a bit complex. i will take your constructive advice. While, a great thanks.;)
Hello World
|
|
|
|
|
It'll pose for an interesting challenge...
How do I print my voice mail?
|
|
|
|
|
This article indirectly shows how to do that.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Dear All,
I am developing a dialog based application using MFC VC++ Version 6.0 for Windows 2000. The application consists of a TabControl derived from CTabCtrl Class having three tab pages in it. Also, the tabControl has Apply, Cancel , Ok button.
My query is how to communicate between the tabpages data and OK,Apply button ??
Similiar case, like "Display properties" dialog box which appears upon right clicking on the desktop. When we select a background and click on apply or ok button to make the changes, the background color gets changed.
Following is the code to create the tab pages. I have radio buttons in first CGeneralSettings page and I want to do various operation after user selects one of the radio button and clicks OK or APPLY button
///////////////////////////////////
The CMyTabCtrl has following datamember:::::::
class CMyTabCtrl : public CTabCtrl
{
public:
CMyTabCtrl();
CDialog *m_tabPages[3];
int m_tabCurrent;
int m_nNumberOfPages;
...
..};
CMyTabCtrl::CMyTabCtrl()
{
m_tabPages[0]=new CGeneralSettings;
m_tabPages[1]=new CAuthorization;
m_tabPages[2]=new CUnInstallation;
m_nNumberOfPages=3;
}
CMyTabCtrl::~CMyTabCtrl()
{
for(int nCount=0; nCount < m_nNumberOfPages; nCount++){
delete m_tabPages[nCount];
}
}
///////////////////////////
Please feel free to ask further clarifications in this regards,
Regards,
Rohit
|
|
|
|
|
All you need is apply,ok method implemented in each tab pages, can call them when you clicked on apply button on the tabcontrol (in a loop maybe).
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Im a BIG NEWBIE so sorry....
I have 5 command sets for doing different tasks in cmd
(Using ---ShellExecute--- in each command set)
This is a simulation of what i am trying to do.
Run the command sets in different order
********
RUN Command set in order of = 2-3-5-4-1
}
Command set-#1
}
{
Command set-#2
}
{
Command set-#3
}
{
Command set-#4
}
{
Command set-#5
}
********
Iv tryed it in class's but failed
How can i write that code ?
|
|
|
|
|
contemptx wrote:
I have 5 command sets for doing different tasks in cmd
What is a "command set?"
contemptx wrote:
(Using ---ShellExecute--- in each command set)
What is it that you are trying to get ShellExecute() to do?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have created a microsoft chart graph. I need to plot around 1400 rows in x- axis which makes graph unclear. Can anybody suggest what solution i can find out to solve the problem?
How can i add a scroll bar to graph so that all the 1400 values can be seen clearly....?
OR is there any other active-x control in MFC which i can use to plot a 3D and 2D graphs.?
Please let me know ASAP.
Thanks in advance
vidya
|
|
|
|
|
Hai frens,
I dono how to insert an JPG image file in the picture control of MFC in VC++.If possible give me an example.
Any one knows plz help.
baljeedurai
|
|
|
|
|
not possible with default image control
look around CP for a subclass which does this...
Actually, thats a darn good idea for a control if one doesn't already exist
Cheers
How do I print my voice mail?
|
|
|
|
|
Do we Have Any Chance of using "Picture" class and loadpicture function as in VB here.If so How to use that class.
Thanks
Balajeedurai
|
|
|
|
|
Probably not using the picture tool inside the dialogbox editor...you'd have to use an activex or subclass that picture tool and render a jpeg instead
How do I print my voice mail?
|
|
|
|
|
I have an MFC executable and an ATL DLL which supports MFC as well.
When the DLL calls AfxGetModuleState it gets the EXE's ModuleState class instead of it's own.
Why does this happen ? What am I missing ?
|
|
|
|
|
is it causing a problem ?
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Yes because when loading resources (AfxFindStringResourceHandle for example), AfxGetModuleState is called.
So, my DLL tries to load a String resource for example, and tries to run through all of the EXE's resource-handles (because AfxGetModuleState returns the EXE's module object) instead of it's own list of resource-handles (stored in it's own module-object).
Am I missing something ?
Does the DLL really have it's own moduleobject ? I'm pretty sure it does, but why isn't it returned then ?
thanks
|
|
|
|
|
When you are loading the resource string, dont you think you need module instance handle of the dll???
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
You can, but the better way is to use AfxFindStringResourceHandle which not only looks in your resource-hinstance but also traverses the CDynLinkLibrary list and any other relevant resource-handles, that's the way to use several resource-dlls at the same time.
Only that it doesn't work in this specific scenario because the module returned is the EXE's one and not the DLLs one...
|
|
|
|
|
Did you insert
AFX_MANAGE_STATE(AfxGetStaticModuleState());
before any MFC call you do from within a DLL function?
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
Nope
Can you tell me more about this ?
What does it do exactly ? Is it possible to do it once per module and not before every call ?
thanks
|
|
|
|
|
|
|
Ok I'm starting to get it,
There is no other solution except for placing this in all my methods that perform MFC calls ? Isn't this abit weird ?
|
|
|
|
|
AFAIK this is the only solution. I don't think it's weird cause you only want to change the module state during the function call, and then set it back to the main application. And adding one line of code isn't too bad, is it ?
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
In the begining of every function that uses an MFC method which in turn uses this DLL's own resources ?
I think it sounds terrible Having to remember to do this, and having other people rememebr to do this. Not to mention having my code cluttered by this line all the time...
I want my module to always use the same AFX_MODULE_THINGY, why can't the AFX methods do AfxGetStaticModuleState() , that is my question actually. Why did they leave it this way ?
|
|
|
|