Re: [libertybasic] Re: More about Question of CURSOR command
- That is COOL!
The cursor coordinates are returned from anywhere on the screen,
independent of open windows.
At 07:46 PM 5/2/03 -0000, you wrote:
>Thanks, Brian, that's kind of what I was trying to do. I modified yourexample to show what I wanted (see code below). Two main points:
>but now it appears that I need to become familiar with calldll's and api's.
>1) I was hoping I could get the job done with standard BASIC commands;
What is the best way to do this? Where are these calls listed and described?
>take into account the real position of the graphics box within the window.
>2) In my example code below, I had to come up with some fudge factors to
These offsets (+5 in x, and +24 in y) are apparently needed because of the
window's frame. Such tactics make pixel-related coding quite tedious since
for example a graphics box does not appear at the x,y you thought it should
because of the effect of a window's frame -- and you can't remove the frame
from a regular window.
>Thanks again -- you've provided me with a good solution!
>WindowWidth = 400
>UpperLeftX = 1
>UpperLeftY = 1
>struct point, x as long, y as long
>statictext #aWindow2.text, "", UpperGX+25, UpperGY+55, 100, 30
>open "Track Cursor" for window as #aWindow2
>print #aWindow2, "trapclose [end]"
>print #aWindow2.g,"when leftButtonDown [end]"
>print #aWindow2.g,"fill yellow"
>open "user32" for dll as #user
>calldll #user, "GetCursorPos", _
>point as struct, _
>result as void
>x = point.x.struct
>y = point.y.struct
>print #aWindow2.text, x; ", "; y
>if (x>=UpperGX+UpperLeftX+5) and (x<=UpperGX+gWidth+UpperLeftX+5)_
> and (y>=UpperGY+UpperLeftY+24) and (y<=UpperGY+gHeight+UpperLeftY+24)_
> then cursor crosshair else cursor arrow
- Well...For the Calldll's and API's Alyces Website is tops for examples
(thanks as always Alyce your website is awesome and a HUGE help )
plus alot of good people on the news group have websites with they're own examples
plus watch for and read the news letters they produce (Great News Letter guys ! )
these are full of great snips and fantastic info that comes in handy down the road
also the http://libertybasic.conforums.com/index.cgi has a wealth of info
you can also do a search through the yahoo groups ...
not to mention http://www.mentalis.org/index2.shtml 900 + API calls in VB
that you can port to LB
Glad i could Help : )
[Non-text portions of this message have been removed]