GrabDesktop error

Discuss GUI programming with the MUI Royale plugin here
Post Reply
User avatar
r-tea
Posts: 123
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

GrabDesktop error

Post by r-tea » Sun Apr 21, 2019 8:16 pm

Can't understand what is wrong with my GrabDesktop test call.
I get "Wrong usage/parameters for this command!" error. It points to the line with GrabDesktop().

Code: Select all

@VERSION 7,1
@OPTIONS {EnableDebug = True}

/*
** This script requires the MUI Royale plugin
*/
@REQUIRE "MUIRoyale", {Link = True}
@FILE 1, "test.xml"


/*
** MUI apps require this information
*/
@APPTITLE "Test"
@APPVERSION "$VER: Test 0.1 (2019/04/03)"

/*
** We don't need our Hollywood display because we have a MUI window
*/
@DISPLAY {ScaleMode=#SCALEMODE_AUTO, Hidden=True}

Function p_Grab()
	GrabDesktop(1, {x=Abs(mx+dx-6), y=Abs(my+dy-6), Width=11, Height=11})
	DisplayBrush(1, 0, 0, {Width=55, Height=55})
EndFunction

Function p_GetMouse()
	mx=MouseX()
	my=MouseY()
	dx = GetAttribute(#DISPLAY, 0, #ATTRXPOS)
	dy = GetAttribute(#DISPLAY, 0, #ATTRYPOS)
	DebugPrint(mx, my, "-", mx+dx, my+dy)
	p_Grab()
EndFunction

/*
** Handles all incoming events
*/	
Function p_EventFunc(msg)
	/*** handle MUI Royale events ***/
   	Switch msg.Class
  	 Case "Window":
      		Switch msg.Attribute
      			Case "CloseRequest":
	 				End()
      		EndSwitch
	EndSwitch
EndFunction


EscapeQuit(True)

InstallEventHandler({MUIRoyale = p_EventFunc})
SetInterval(1, p_GetMouse, 40)

/*** main loop!	***/
Repeat
	WaitEvent
Forever 

User avatar
r-tea
Posts: 123
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: GrabDesktop error

Post by r-tea » Sun Apr 21, 2019 9:56 pm

Solved. It's simply because negative values :oops:

Post Reply