Screen Extensions

——————————————————————————–

Screen Extensions 2016 Release 1
Domador Software Components for Xojo

Copyright 2016 Domador Software S.R.L.
http://www.domador.net
support@domador.net

——————————————————————————–

———
Overview
———
Domador Software’s Screen Extensions provide additional, helpful information about Screen objects.

——
Usage
——
Before calling any other method in this library, you’ll need to call the RegisterLicenseKey function with your license key:

ScreenExtensions_Domador.RegisterLicenseKey(“PlaceYourLicenseKeyHere”)

or

ScreenExtensions_Domador_Private.RegisterLicenseKey(“PlaceYourLicenseKeyHere”)

This method only needs to be called once (but calling it multiple times does no harm, other than slowing your
program down a bit). Not calling this method will cause an exception to be raised in compiled programs, and
a registration reminder to be displayed in debugging builds.

It would be highly advisable for you to obfuscate the string and/or encrypt your license key in any applications
you release. The last part of this reference document provides additional information, including tips on how
to accomplish this.

Please make sure to include at the following module in your project, in order for the Screen extensions to work:

ScreenExtensions_Domador_Private

The demo project for the Window Placement and Screen Extensions can be used as a starting point for a
new application. In order to adapt it to your needs, you are free to do the following:

1) You can delete/modify anything outside the Domador Software folder.

2) Within the Domador Software folder, you can delete the Tests folder and its contents. They are not needed for the extensions to work.

3) You are free to adapt and use anything inside the Tests folder in your project, as well as anything outside the Domador Software folder.

4) You are also free to modify the ScreenExtensions_Domador module, with the exception of the EULA note, which you may delete
but not alter. Even if you delete it from your project, you need to abide by its terms.

5) Usage of the ScreenExtensions_Domador_Private module is regulated by the EULA,
the Window Placement and Screen Extensions End-User License Agreement.

—————–
Special Features
—————–
– This library is designed to prevent namespace clashes as much as possible, and also to make it easy to resolve such clashes if they occur.
– The ScreenExtensions_Domador module can be renamed if desired.
– Any of the methods in ScreenExtensions_Domador can be renamed or deleted as needed or desired.
– All user-accessible methods and properties in ScreenExtensions_Domador_Private have Protected scope.
None of these methods’ and properties’ names will conflict with names in the Global namespace.
– For a tiny increase in speed, you can copy the method calls inside the methods ScreenExtensions_Domador and
use them directly within your own code.
– You can change the default values for methods in ScreenExtensions_Domador if you prefer different defaults.

————-
Compatibility
————-
All of the methods work on Windows. Most should work on Mac and Linux. (Light testing has been performed on a Mac. The methods are untested on Linux.)

The following method is Windows-only:

Number

””””””””””””””””””””””””””””””””””””””””
‘ Method Reference
””””””””””””””””””””””””””””””””””””””””

‘ Parameters in [ ] (square brackets) are optional and can be omitted, as long as the remaining non-optional parameters appear in the correct order.

Dim Scr as Screen

‘ Bottom coordinate of the screen or available
IntegerValue = Scr.Bottom
IntegerValue = Scr.BottomEdgeOfAvailableArea

‘ Whether the screen contains a given point
BooleanValue = Scr.ContainsPointXY(x as Integer, y as Integer)

‘ The horizontal center of the screen or the available width
IntegerValue = Scr.HorizontalCenter([AccountForAvailableArea as Boolean = false])
IntegerValue = Scr.HorizontalCenterOfAvailableWidth
IntegerValue = Scr.HorizontalCenterOfScreen

‘ The number (array index) for the Screen method that corresponds to this screen (Windows-only)
IntegerValue = Scr.Number

‘ Verifies the license key and unlocks access to the methods in this module (if the license key is valid)
RegisterLicenseKey(LicenseKey as String)

‘ Right coordinate of the screen or available
IntegerValue = Scr.Right
IntegerValue = Scr.RightEdgeOfAvailableArea

‘ The screen or screen number (if any) that corresponds to a given point
ScreenObject = ScreenForPointXY(x as Integer, y as Integer)
IntegerValue = Scr.ScreenNumberForPointXY(x as Integer, y as Integer)

‘ The vertical center of the screen or the available width
IntegerValue = Scr.VerticalMiddle([AccountForAvailableArea as Boolean = false])
IntegerValue = Scr.VerticalMiddleOfAvailableHeight
IntegerValue = Scr.VerticalMiddleOfScreen(Extends screen as Screen)

””””””””””””””””””””””””””””””””””””””””
‘ Licensing and registration
””””””””””””””””””””””””””””””””””””””””
‘ Verifies the license key and unlocks access to the methods in this module (if the license key is valid)
Protected RegisterLicenseKey( LicenseKey as String )

””””””””””””””””””””””””””””””””””””””””
‘ Protecting your license key
””””””””””””””””””””””””””””””””””””””””

‘ It would be highly advisable for you to obfuscate and/or encrypt the string(s) containing your license key in any applications that
‘ include these extensions. This will make it harder for your license key to obtained by unauthorized users (if they inspect
‘ the binary file for your application). Domador Software S.R.L. reserves the right to invalidate keys that are disclosed to
‘ unauthorized users. Domador Software S.R.L. will decide at its own discreation whether to provide a free replacement key
‘ to the legitimate user of an invalidated key.

‘ Invalidated keys will keep working where used, but won’t be usable in newer releases of this library.
‘ Please help protect our livelihood by obfuscating and/or encrypting your license key. Here are some ideas for doing this.
‘ You can also design your own obfuscation/encryption schemes, if you have the corresponding skills.

””””””””””””””””””””””””””””””””””””
‘ Idea A: Encrypt your application with an application packer.
””””””””””””””””””””””””””””””””””””
‘ Before releasing your application, pack and encrypt it with an executable packer, such as The Enigma Protector (http://enigmaprotector.com/).
‘ Using a packer has its pros and its cons (such as a greater likelihood of false-positive virus detections in your application by antivirus engines).

””””””””””””””””””””””””””””””””””””
‘ Idea B: Obfuscate the strings in your project
””””””””””””””””””””””””””””””””””””
‘ You can use Arbed (http://www.tempel.org/Arbed/Arbed) to obfuscate the license key’s string
‘ (along with other strings, if desired), before releasing your application.

””””””””””””””””””””””””””””””””””””
‘ Thank you very much for your help.

Copyright © 2020 Domador Software S.R.L.