|
llp00na wrote: I appreciate your help very much
You're welcome. Just keep me informed if you find a solution and how you did it. I'm interested.
Good luck
|
|
|
|
|
Yep. Yesterday while i was trying to figure out how to use mouse hooks. Someone told me that there is no need to perform hooking at all. Instead he recommended to override the PreTranslateMessage. He proposed the following code:
BOOL CPilotStudyDlg::PreTranslateMessage(MSG* pMsg)
{
if(WM_LBUTTONDOWN == pMsg->message)
{
fprintf(trial, "\nMouse: x = %i, y = %i ", LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
fflush(trial);
}
return CDialog::PreTranslateMessage(pMsg);
}
It works really fine. However i have a slight problem, in my browser i have an address bar (where user enters url) that placed above the control. Whenever i click on the address bar i receice a *y* value that is bigger than the value of *y* received when clicking on the control (just beneath the address bar).
I dont know why this is happening, *y* values should get bigger as i move from the top towards the bottom but its not the case.
If you have any clue why this might be happening, please share.
Cheers
llp00na
-- modified at 5:13 Thursday 11th May, 2006
|
|
|
|
|
llp00na wrote: Instead he recommended to override the PreTranslateMessage
I don't think this is a good idea: what you need (from what I understood) is getting a message when the user clicks on the control, not on the dialog (am I wrong ?). So, it is better that the control fires the event when you click on it, so that you get notification in the dialog (and you can retrieve the X and Y position ON the control).
llp00na wrote: Whenever i click on the address bar i receice a *y* value that is bigger than the value of *y* received when clicking on the control (just beneath the address bar).
That's strange... I don't know what the problem is. But what position do you need to retrieve exactly ? The position on the dialog on the position on the control (they are different because the upper-left corner is considered as the reference point for the position on the control).
Maybe, before going further, it could be very helpfull for me to understand what you are trying to achieve: why do you want to get these mouse events and for what purpose (and why you need the position). What is the control used ? ...
|
|
|
|
|
I am trying to build a web browser-IE in which users will be clicking on their areas of interest, for that reason I have to capture the x,y of user left clicks on the control (web browser). I am gona be needing to perform some comparison between the captured (x, y)s
I have been looking at the html element events and it looks like it only returns the html elements that have been clicked. It does not return the exact (x,y).
Capturing the exact x,y of user left clicks will always allow me to access the corresponding html element using pHTMLDocument2->elementFromPoint(x, y, &htmlElement);
However, handling html element events will only allow me to access the relevant html elements. I wont be able to retrieve the (x,y):
Handling html element Events. Please correct me if i am wrong
well for the positiong problem. I dont care which point is to be set as a reference, as long as it is consistent. ie, the top left corner of the client area is the reference or the top left corner of the control is the reference. I cant afford havign two reference points which seems to be the case for me now. whenever i click on the address bar i get a *y* value that is greater than the *y* value retrieved when clicking on the top left corner of the control .
I hope it is clearer now.
llp00na
-- modified at 6:11 Thursday 11th May, 2006
|
|
|
|
|
I can email you the whole application if u want ? you would then probably be able to diagnose it.
thanx
llp00na
-- modified at 9:08 Wednesday 10th May, 2006
|
|
|
|
|
This won't help because I don't have visual studio installed here at work.
|
|
|
|
|
Dont assign class from classwizard for the dialog bar on which you are calling on left button .
Only way you can access the controls on gui is the way I shown.
this m_wndDlgBar variable gets automatically assign in CMainFrame when
you have derived view from CHTMLView and on STEP 4 of wizard you must opt
for Internet Exporer Rebar option. I dont know how you are creating activex
but hope you will be using htmlview.
m_wndDlgBar.GetDlgItem(IDC_EDIT1)->GetWindowText(sm); // CString sm; defined.
((CWebBrowseView*)GetActiveView())->Navigate2(sm);
|| ART OF LIVING ||
|
|
|
|
|
Actually i am using a dialog based application. I have then added the microsoft web browser activex control to the dialog.
so its pretty different from what you described.
llp00na
|
|
|
|
|
How Can I Make Achild Window In Win32 .
I Need The Child Window With Out Close button , i,e in the midddle of the parent window
|
|
|
|
|
are you building an mfc application ???
llp00na
|
|
|
|
|
Are you using a dialog from resource? If set style as child and Uncheck the System Menu check box in Dialog Property. Also you have to launch it by using Create API.
- NS -
|
|
|
|
|
F.Smadi wrote: How Can I Make Achild Window In Win32 .
Any window with a style of WS_CHILD is a child window. What matters is the parent window.
F.Smadi wrote: I Need The Child Window With Out Close button , i,e in the midddle of the parent window
To center a window use CenterWindow(...)
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
How Can I Make Dual Window With OpenGl .
One for Display 3ds files and the second to display text .
|
|
|
|
|
Can anyone point me towards any examples of custom controls that are derived from CDialog? I've been searching for a while, and just can't find everything useful (just controls derived from CWnd, which doesn't seem to work properly for me - my dialog seems to just fail DoModal when my control is placed)
Thanks
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
benjymous wrote: Can anyone point me towards any examples of custom controls that are derived from CDialog?
You cannot make your custom control inherit from a CDialog (as far as I know)
benjymous wrote: (just controls derived from CWnd, which doesn't seem to work properly for me - my dialog seems to just fail DoModal when my control is placed)
Instead of looking for crazy replacement solutions, why don't you simply correct the problem ? What is the problem exactly with your control and your dialog ? What do you mean by fail DoModal ? The function is exited immediately ?
Can you provide more information about your custom control: do you register it (with RegisterClass) ? If yes, are you sure the name you put in the resource editor (for the class property of the control) is the same than the one you used ?
-- modified at 7:13 Wednesday 10th May, 2006
There is a tutorial here[^] that explains how to use custom controls
|
|
|
|
|
I have one dialog with CRichEditCtrl and a button. The function OnButton() will do the following:
- display 'Please wait..' in rich editor
- do some processing
- display 'Done' in rich editor.
- exit.
Now, my problem is, the rich editor will not display 'Please wait..' immediately. Instead, the rich editor will display 'Please wait..' and 'Done' only after the OnButton() is exited.
How can I force the rich editor to refresh immediately?
|
|
|
|
|
Do the processing in a separate thread. That will keep the dialog "alive" during the processing.
|
|
|
|
|
Is there a simple way besides having a thread?
|
|
|
|
|
Sorry for the late answer.
Yes, you can have your own message pump function and make sure you call it every once in a while during the lenghty processing.
-- modified at 6:00 Friday 12th May, 2006
|
|
|
|
|
after you write the "please wait" message, try calling RedrawWindow() on the rich edit object to force an immediate repaint. Then continue with the processing.
If pRichEdit is a pointer to your rich edit object, then you would call pRichEdit->RedrawWindow().
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
|
I have an application with several rich edit views, and one of them is used as a running log. When two or more additional rich edit views are opened, the log slows right down; the slowdown happens in the view rather than in the code generating the log.
All of the rich edit views in the application use SetSelectionCharFormat() to set character formatting; if I comment out the calls in the log, which are to colour text and underline links, it runs at full speed.
Should I:
- Optimise the calls to SetSelectionCharFormat() to remove calls that repeat the existing format or where no text is output using them?
- Use RTF streaming instead of SetSelectionCharFormat?
- Buffer the log instead of displaying it continuously?
- Abandon rich edit views for another technique altogether?
|
|
|
|
|
I got some trouble with a mdi frame derived from Ctreeview, i need update my treeview data (insert or setitem several items very often ~100ms) and there is a blinking effect. When i use a CListView class to display my data i don't have such problem... Is it possible to do something to prevent my view from blinking my optimizing something? Thanks in advance. If someone needs more precisions please ask. Bye
|
|
|
|
|
|
It's is already done but it didn't do anything...
|
|
|
|