| View previous topic :: View next topic |
| Author |
Message |
Robert Switz Newbie
Joined: 07 Dec 2002 Posts: 6
|
Posted: Sun Dec 08, 2002 3:46 am Post subject: WINDOWS 2K and VDS2.5 / 3.51 Window Click |
|
|
I Just ran in to this problem, probably an old problem but does any body have a fix “Window Click,windowname,X,Y” just not working. As if it didn’t see the command everything before and after executes.
Any Ideas?
Thanks Bob |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Dec 08, 2002 9:57 am Post subject: |
|
|
Can you drop us the source code for that so we can take a look?
-Garrett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 2:49 pm Post subject: |
|
|
Hey Bob,
I just remembered something (you may have already
allowed for this)...
The WINDOW CLICK X and Y are absolute on the window
(from top left corner of the title bar), not just the client area,
so ya gotta allow for title bar height, menu height, etc.
I've been tweaking an old routine of Garrett's (not finished
testing it yet) to get these for various system settings, and
am gonna post an example later with different layouts.
Meanwhile, ya might check if this WINDOW CLICK example
works on your system...
Clicking B2 should WINDOW CLICK on the upper left corner
of B1. If it doesn't, ya might try try adjusting %x and %y
(ya should be able to see where the mouse cursor goes).
__________________________________________________________________________________________________________________________
| Code: |
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"Test Program",-1,0,300,200
%%hwnd = @winexists("Test Program")
GOSUB GetWindowSpecs
DIALOG ADD,BUTTON,B1,5,5,40,22
DIALOG ADD,BUTTON,B2,5,255,40,22
DIALOG ADD,STATUS,Stat
DIALOG SHOW
DIALOG SET,Stat, Border= %%b_width Title= %%t_height Menu= %%m_height Status bar= %%sb_height
:EVLOOP
WAIT EVENT
goto @event()
:B1BUTTON
INFO B1 has been WINDOW CLICKED...@tab()
goto EVLOOP
:B2BUTTON
%x = 5
%y = 5
WINDOW CLICK,%%hwnd,@sum(%x, %%b_width),@sum(%y, %%t_height)
goto EVLOOP
:CLOSE
EXIT
rem -------- SUB ------------
:GetWindowSpecs
rem -- Get systemwide titlebar, status bar, menu height, and border width --
%c = "TempWindowToGetWindowSpecs"
rem -- Normal and RESIZABLE have different title heights --
rem -- Resizable:
rem DIALOG CREATE, "GetWindowSpecs",-1,0,200,200,RESIZABLE,CLASS %c
rem -- Non-resizable:
DIALOG CREATE, "GetWindowSpecs",-1,0,200,200,CLASS %c
%%b_width = @div(@diff(@winpos(#%c,W),200), 2)
%%t_height = @diff(@diff(@winpos(#%c,H),200),%%b_width)
%%sb_height = @diff(%%t_height, %%b_width)
DIALOG ADD,MENU,MenuTest
%%b_width = @succ(%%b_width)
%%m_height = @diff(@winpos(#%c,H),@sum(200,%%b_width,%%t_height))
%%t_height = @succ(%%t_height)
%%m_height = @succ(%%m_height)
DIALOG CLOSE
%c = @event()
%c = ""
exit
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Robert Switz Newbie
Joined: 07 Dec 2002 Posts: 6
|
Posted: Mon Dec 09, 2002 8:02 pm Post subject: I found the trouble |
|
|
There is a problem with the window spy in VDS3.51 it doesn't give the window X, Y it gives the whole screen X,Y
Thanks All |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|