You should use an older version, for recognize
SetDesktopAsClient function.
If I remember good, you can use a version from 3.25 to 3.34.
As you can see, your code uses some functions, listed in the old manual :
Alternatively, you can find the "new"
SetDesktopAsClient in the new manual :