In this example, we find the current Desktop object and retrieve the current automatic lockup option setting.
WPDesktop *Desktop;
BOOL bAutoLockup;
Desktop = _wpclsQueryObjectFromPath("<WP_DESKTOP>");
bAutoLockup = _wpQueryAutoLockup(Desktop);