Δευτέρα 11 Δεκεμβρίου 2023

Lock WorkStation.

Checked for Windows 11. This small utility just declare a function which exist in User32.dll and call it (because return 1, and a call with a non zero value is the same as raising error with the non zero value as error code, we have to include the clause Void, to skip the use of the return value).

Internal: M2000 interpreter make an object with attributes the lockWorkStation, and the User32.dll, but without checking for existance, until we first time call it. There is a cache memory for the linked functions, so calling more time the lockme module, we didn't waste resources (by loading more than one the User32 library of functions)..


module global lockme {
Declare LockWorkStation lib "User32.LockWorkStation"
Call void LockWorkStation()
}
lockme