Skip to content
Dimitri edited this page Feb 11, 2023 · 4 revisions

Config System


Overview

The config system in Display Lock takes the SETTINGS struct object and writes the binary data to a file with the .DLOCK extension. This file is written when the file closes to the users roaming appdata folder. This folder can be accessed by using %APPDATA%\DisplayLock\settings.DLOCK. This file location has been chosen to keep the program portable, meaning the user can drag the executable file anywhere on the desktop and it will still run.


Settings Structure

Declared in dispLib\include\common.h

struct SETTINGS
{
    char header[6];
    int version;
    BOOL minimize;
    BOOL foreground;
    BOOL borderless;
    BOOL fullScreen;
    int numOfHotkeys;
    HOTKEY hotkeys[1];
};
Variable Data Type Description
header char[] The header for the config. This will always be set to DLOCK\0 to ensure the file format is proper
version int Version of the config. When any thing is added to the SETTINGS struct or the file being saved, this number must be incremented in the string table in the resource file
minimize BOOL When the user has this checked, the program will minimize when the start button is pressed
foreground BOOL When this option is checked, the program will bring the selected window to the foreground
borderless BOOL When this option is checked, the program will convert the selected window to a borderless window style
fullScreen BOOL When this option is checked, the program will resize the window to the main monitor width

Hotkeys


struct HOTKEY
{
    int id;
    int modifiers;
    unsigned int key;
};
Variable Data Type Description
id int Action associated with the hotkey. This message will be sent do the WPARAM of a WM_HOTKEY message to the main window loop
modifiers int This is any key modifiers. This can be zero for no modifiers or it it can contain bits that have been or'd together. See MSDN for more information.
key unsigned int This is the key that is pressed. Together with the modifier a hotkey can be registered.

Applications Structure

This struct is stored in %APPDATA%\DisplayLock\applications.DLOCK. These are the applications settings for the application white list feature.

struct APPLICATION_LIST
{
    int count;
    APPLICATION_SETTINGS *applications;
};
Variable Data Type Description
count int The number of APPLICATION_SETTINGS store in the struct.
applications APPLICATION_SETTINGS A dynamically allocated member that reads / writes the of N applications to a config
Clone this wiki locally