|
When you call SetWindowText() from within OnInitDialog() , an EN_CHANGE notification will eventually get generated. What you simply need to do is differentiate between the control's contents changing during initialization vs. the user changing it. The simplest way is to add a m_bInitialized variable to the dialog. Set the variable to false in the dialog's constructor, and then set it to true at the very end of OnInitDialog() . Now in each of the EN_CHANGE handlers, only alter the OK button if m_bInitialized is true. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
When you call SetWindowText() from within OnInitDialog(), an EN_CHANGE notification will eventually get generated.
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I thought EN_CHANGE notifications are only sent in response to a user (vs. programmatic) action that changes the contents of an edit control.
But now you know otherwise.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I am working with MS FlexGrid and VC++ 6.0(MFC). I need to load a picture(bmp) to the cell of the flexgrid.
How can I do this?
TIA,
Regards,
Jahfer V P
|
|
|
|
|
|
Dear Suhredayan,
Thank You for your great help.
The sample you pointed out helped me to reach the destination.
Here is the way that I implemented it. It is very simple.
/******************************/
CPictureHolder picHdr;
picHdr.CreateFromBitmap(IDB_BITMAP1);
m_FlexGrid.SetCol(2);
m_FlexGrid.SetRow(1);
m_FlexGrid.SetRefCellPicture(picHdr.GetPictureDispatch());
/******************************/
Thanks & Regards,
Jahfer V P
|
|
|
|
|
|
Thats all, i need to get the line index where the cursor is placed in a CRchEditCtrl.
Thanks
|
|
|
|
|
check for EM_EXLINEFROMCHAR message in msdn.
suhredayan There is no spoon.
|
|
|
|
|
hi all
i used API function hWndApp=FindWindowEx(0,0,"Notepad",0),and then i want to send WM_MBUTTONDBLCLK message to hWndApp but it didn't work as i think...
i send WM_MBUTTONDBLCLK message to hWndApp,and then send WM_COPY message to hWndApp so that i want to copy word what is highlighted (when call WM_MBUTTONDBLCLK message) to Clipboard (so call WM_COPY message)>>>but i didn't know how to code correctly///
please help me...
thanks...
Here we go!!!
|
|
|
|
|
|
i have read your code>>>that's very useful>>>and thank you so much
but 1 more question for you///please
after enumming all childwindows of mainwindows that can get HWND easily>>>but how to get HWND of edit childwindows that always are used in a typing program.Because we really don't know contents of edit childwindows if we use GetWindowText() in EnumChildProc() function to get HWND hic hic///
i really understand all that you code...
thanks...waiting for you hic hic
Here we go!!!
|
|
|
|
|
Hi,
I have an application (in VC++ 6.0) wherein it displays the images in ListView. So the application starts displaying the images from the Top left corner (0,0).
Now I have added the manifest file (to give XP look to application) in applicatoin resource successfully. (as outlined in the below mentioned link http://www.codeguru.com/Cpp/controls/controls/article.php/c5227/[^])
The application is having the XP look but the images are displayed from the Bottom left corner.
Question:How to set the origin of the ListCtrl to top left corner (0,0) so that the images are displayed from the top left corner (0,0) ?
Thanks & Regards,
Neeraj
|
|
|
|
|
Why can't i use Ctrl+C,V like commands with CFormView. When i want to use it doesnt respond.
is there any way to activate them.
I'm using SDI style.
|
|
|
|
|
Implement your own handler for WM_COPY message to CFormView. Because by default CFormView dosen't implement it.
suhredayan There is no spoon.
|
|
|
|
|
this works but i guess i must write some code.
Thanks
|
|
|
|
|
Add accelerators for Ctrl+C, Ctrl+V, and any other keys you want. The AppWizards make Edit menu commands with IDs of (I think) ID_EDIT_COPY , ID_EDIT_PASTE , and so on, so use those same IDs for the accelerators and add command handlers using those IDs as well. Then the menus and accelerators will go through the same handler.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
void CClass::OnEditCopy()
{
// TODO: Add your command handler code here
((CEdit*)GetFocus())->Copy();
}
I write the code above for(copy,paste,cut,undo). these already have acceleretors. They seem to work. When i want to use on a combobox, as guessed it doesn't copy but at least there is no errors.
|
|
|
|
|
Hi
I would like to ask you how to select a line drawn between 2 points
Thanks
Javi
|
|
|
|
|
What do you mean by 'select a line drawn between two points' ?? Which points, which line and what type of project are you using, from where this line comes from ?? And what do you want to do by 'selecting' a line ???
We are missing a LOT of informations, se be more explicit if you want an answer
|
|
|
|
|
Sorry....
I want to do an ActiveX that automatically link two points doned. After linking the two points with a line I would like that if the user hoves the mousse on the line, it display a message (tip)..
Ok the program is a network monitoring. And I have to represent graphically the packets through it-->source-destination...So I will display the different IPs addresses and link them with a line.The user should also be able to do Right-Button in a text to get options (popup menu)..How can I do that if the we do R-Button in a text...show a popup menu? The popup menu is OK, the problem is to know how to send the message that we have done R-Button on the Text
Thanks
|
|
|
|
|
javi_jmc wrote:
I want to do an ActiveX that automatically link two points doned. After linking the two points with a line I would like that if the user hoves the mousse on the line, it display a message (tip)..
Are you using the MFC's ? If yes, your main ActiveX window (I think this is the COleDispatch or something like that) inherits from CWnd so you can retrieve mouse moves and events like a normal control. Then for showing a tooltip when the mouse is over the line, you will need to find the equation of the line using the two points coordinates (you can find equations on the web, I don't remeber them ). But I would suggest you to show the tool tip only when the mouse is over a point (much easier because you won't have to find the regression). You'll need of course to define a margin (for example 5 pixels around this point).
javi_jmc wrote:
The popup menu is OK, the problem is to know how to send the message that we have done R-Button on the Text
Do you want to send an event to the client of your object or do you want that the events will be handled by your ActiveX itself ? I would recommend the second solution because (I think, I don't see all of your code) this is typical events for the ActiveX control. So, here the answer is the same as above: you can have mouse events and based on these mouse events (mouse clicks, moves, ...) you can display a popup menu (I suppose you use the CMenu class ?)
Hope this helps
|
|
|
|
|
Place your mouse on the first point and drag to the other point by keeping the left_mouse_bttn pressed
suhredayan There is no spoon.
|
|
|
|
|
well i ahev already created a dialog based application,but right now i am required to put up a window before the main window comes up!
so here is what i did .....
i took up the CXyzApp class.....and there i called the window before the main window....the prob is that i need thiz window to run side by side the main window,but the way i have implemented right now makez the window run,and when it exitz only the control goes back to the CXyzApp and then from there to the main dialog!.....so herez my question.....
how do i run both these windows together....that is how do i get back the control from the new window to the main application so that i can call the main window also?(by the way...i am required not to make the new window called from the main window)
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|