User Tools

Site Tools


preventing_20a_20library_20from_20being_20run

Preventing a library from being run

by Jon Ripley, July 2006, January 2007

To prevent a library from being run add the following code to the start of the library after any initial comment block to generate a syntax error when a user tries to run your library:

        ;


To generate a more descriptive error instead add the following code to the start of your library:

        SYS "MessageBox", @hwnd%, "This is a library and cannot be run.", 0, 48
        QUIT


The message appears in a message box and the program will quit when it is dismissed. This necessarily adds 78 bytes to the library, even when added to a compiled program, but ensures that the library will not be executed and alerts users that the library is not an executable program.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
preventing_20a_20library_20from_20being_20run.txt · Last modified: 2018/04/15 18:21 by tbest3112