|
I assume the logic to determine the time is in your child dialog. If that is the case,
1) If you used GetCursorPos(...) to get your point, then you have to call ScreenToClient(...) to convert them to client coordinates.
2) Then before you display your child dialog with DoModal(), store these coordinates in your child dialog.
|
|
|
|
|
if the point in the main dialog is (428,500) by using this
ScreenToClient iget x=-5;
so please help me,
sree.
|
|
|
|
|
sree_as wrote: if the point in the main dialog is (428,500)
Post some code on how you get your point, as well as the part where u call ScreenToClient(...)
|
|
|
|
|
i used this in on timer in child window
GetCursorPos(&cp1);
ScreenToClient(&cp1);
i think screentoclient taking client as child window.
sree.
|
|
|
|
|
ScreenToClient(...) takes 2 parameters, first one is a handle to your window, the second is your point. Since you are calling this in your child window, then you have to call GetParent() to get the handle to your parent window and pass it into ScreenToClient(...). e.g.
GetCursorPos(&cp1);
HWND hParentWnd = GetParent();
ScreenToClient(hParentWnd, &cp1);
|
|
|
|
|
Weiye Chen wrote: GetCursorPos(&cp1);
HWND hParentWnd = GetParent(/* Handle to your child window */);
ScreenToClient(hParentWnd, &cp1);
I Think following change sholud be there in program.
<br />
::ScreenToClient(hParentWnd, &cp1);
Check the Scope Resolution Operator( :: ) before ScreentoClient API.
I Think this correction should be there.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
sorry to say that the properties of the second dialog is not child it is pop up .is ur code is applicable to this one also,
sree.
|
|
|
|
|
sree_as wrote: sorry to say that the properties of the second dialog is not child it is pop up .is ur code is applicable to this one also,
Yes, it is applicable as well.
|
|
|
|
|
i got an error getparent does not take one parameter
|
|
|
|
|
Try putting the scope operator asMahesh have pointed out:
GetCursorPos(&cp1);
HWND hParentWnd = ::GetParent();
::ScreenToClient(hParentWnd, &cp1);
|
|
|
|
|
i think problem with my popup handle shall u show me ow we do it.i just verify it.
thank u ,
sree
|
|
|
|
|
sree_as wrote: i think problem with my popup handle shall u show me ow we do it.i just verify it.
If your problem is solved, then good for you cos i dont quite understand what you are talking about.
|
|
|
|
|
again iam getting window coordiantes.not parent co-ordinates
please help me.
CProfileWindow myWindow;
HWND hParentWnd = ::GetParent(myWindow);
::ScreenToClient(hParentWnd, &cp1);
|
|
|
|
|
Didn't you said you are calling it from OnTimer of your child window? If that's the case, then you should get the handle of that window for GetParent(...).
Btw, are you using mfc?
|
|
|
|
|
"that window",which window should be handled,yes,iam calling from OnTimer(),can u explain in detail please,
sree.
-- modified at 7:12 Monday 19th June, 2006
|
|
|
|
|
If you are using mfc, then you can do this:
AfxGetMainWnd()->ScreenToClient(&cp1);
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
thank u very much,
really u helped me a lot,
sree.
|
|
|
|
|
Other than DDE, what other technologies exist through which two applications can communicate with one another?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
1.Com
2.Socket
3.Messages
4.Shared memory
5.Events, mutex etc
nave
|
|
|
|
|
Apart from already being said, there is pipes, named and unnamed.
|
|
|
|
|
one more WM_COPYDATA
"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
|
|
|
|
|
Remote Procedure Call (RPC).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
1. Write data from memory to file on disk, read data from file back into memory
2. Null modem cable, loop it from COM1 to COM2 - one program writes to COM2 and the other reads from COM1 and vice versa
Just kidding ...
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
How to access database(MS Access or Oracle) from c++ ?
sandi
|
|
|
|
|
Use CDatabase class
See Here [^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|