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. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
preventing_20a_20library_20from_20being_20run.txt · Last modified: 2024/01/05 00:21 by 127.0.0.1