Post Reply Home » Forums » General » Site News

ScriptHost version 2.7.12 : Site News

Posted: December 16th, 2004
User avatar
Total Posts:1168 Joined:2004
December 16, 2004
ScriptHost version 2.7.12

Added a few scriptHost functions.
Function Win32API.XUGetForegroundWindow() As Long 'See GetForegroundWindow API microsoft.
Function Win32API.XUGetClientRect(ByVal hwnd As Long, lpRect As tagRECT) As Long 'See GetClientRect API from microsoft.
Function Win32API.XUScreenToClient(ByVal hwnd As Long, lpPoint As tagPOINT) As Long
Function Win32AP.XUClientToScreen(ByVal hwnd As Long, lpPoint As tagPOINT) As Long


I Also updated GetPixelColor to more accuretly reflect the color on the screen.
Public XUScriptHostGetPixelColor(ByVal X As Long, ByVal Y As Long, Optional hwnd As Long) As Long

The added optional hwnd is for the window handle. It will default to 0 (desktop) if not supplied for backwards compatibility. However, if you call XUScriptHost.GetForegroundWindow and pass that as the hwnd, it will get the pixel (x,y) of the game window. This is very handy for fullscreen applications that might cause the getpixelcolor function to return an invalid color.

The other functions may be needed to help with conversion form full screen to windowed coordinates. Ie, if you are getting the pixel location from the x,y passed from GetCursorPos, those will be in screen coordinates which will need to be converted to game coordinates via the XUScreenToClient function.
Posted: December 16th, 2004
User avatar
Premium
Total Posts:6718 Joined:2004
It is bugged, roll it back plz.

It is causing my functions to return all 0.

_________________
Use Search first, ask questions later!
Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 18 guests
Post Reply