|
-
Dec 31st, 2002, 03:43 AM
#1
Thread Starter
Addicted Member
ClientToScreen(&CPoint);
IN VC++
ClientToScreen(&CPoint);
ClientToScreen(&CRect);
but
in bc++
ClientToScreen(&CPoint);
is it true?
while using
ClientToScreen(&CPoint);
it goes out of window.How to use it?
-
Dec 31st, 2002, 07:03 AM
#2
ClientToScreen is a WinAPI function wrapped up by MFC's CWnd and probably by VCL's TWnd (or whatever) too.
The original version is passed a POINT *, I guess TPoint is derived from POINT just like CPoint, so TPoint * should work.
What do you mean it goes out of the screen?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 31st, 2002, 08:22 PM
#3
Thread Starter
Addicted Member
if the initial position of window starts in (0,0) of desktop screen
then while clipcursor(&rect) mouse draggs within the windows if it displaces again the mouse graggs from (0,0) of the desktop to length of window.
so how to convert the coordinates?
-
Dec 31st, 2002, 11:08 PM
#4
Can you rephrase that? I don't understand.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 1st, 2003, 10:13 AM
#5
Thread Starter
Addicted Member
Rect=GetClientRect();
ClientToScreen(TPoint(Rect.left,Rect.top));
SetCapture();
ClipCursor(&Rect);
Above are the codes I have written.
when I run my program.if my window's top-left angle is conside with top-left of desktop that is Point(0,0) then it works ok but if not conside when I drag my mouse over my window it draw correctly on mywindow but the cursor goes out of my window.
The mouse pointer should be insided my window even if I tried to move out of my window.
-
Jan 1st, 2003, 01:12 PM
#6
TPoint(rect.left, rect.top)
creates a copy of those coordinates. It won't alter the original rect.
Actually I am surprised this is allowed at all. Logically the prototype of the function has to be
void TWnd::ClientToScreen(TPoint & pt);
but then you shouldn't be able to pass a TPoint object created on the fly to it. The only explanation I see is that the Borland compiler is worse than I thought.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 2nd, 2003, 04:13 AM
#7
Thread Starter
Addicted Member
Do you have bc++5.I will put all my codes here so that you check it?
Thanks
-
Jan 2nd, 2003, 06:07 AM
#8
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|