|
ANY-maze Help > The ANY-maze reference > ANY-maze plug-ins > Plug-in API reference > AME_EDITSETTINGS message AME_EDITSETTINGS message
The AME_EDITSETTINGS message is sent to a plug-in as a request for it to display some type of interface for the user to edit the plug-in's settings. Typically, this is a dialogue box. Plug-ins do not have to implement any settings, and so you can simply return AME_NOTIMPLEMENTED to this message if desired. ParametersguidPointer to the GUID of the plug-in whose settings are to be edited. If a DLL only implements a single plug-in, it can ignore this parameter - although it is good practice to always check it. wParamSize of the settings buffer pointed to by lParam, in bytes. lParamPointer to a buffer which holds the plug-in's settings. When first passed to a plug-in, this buffer will be filled with zeros. See Remarks section. Return valueThe only valid return codes from this message are:
If the settings have been edited and should now be saved by ANY-maze, then return AME_OK. If the user cancelled the editing of the settings (for example by clicking a Cancel button), return AME_CANCELLED. If the plug-in does not have any settings, then return AME_NOTIMPLEMENTED. If an error occurs, return AME_ERROR. RemarksWhen first passed to a plug-in, the settings buffer will be filled with zeros. The plug-in should detect this and set the settings to default values. An easy way to detect uninitialised settings is to include a boolean 'Initialised' value as the first field of your settings record. Thus if Settings->Initialised is false, you know the settings are uninitialised - so you can set them to default values and then set the Settings->Initialised flag to true. The size of the Settings buffer is 48 bytes (which will be the value passed in wParam); you don't need to use all of this for your settings, although you can't use more. It is a good idea to check the size of your settings record against the wParam, to avoid a buffer overflow. ANY-maze saves the settings for a plug-in as part of the protocol. Thus the settings in different protocols can be different. It is not a good idea to save your settings in the Windows Registry, as doing so will mean that the settings will be the same for all experiments - unless, of course, this is exactly what you want. If you do need such 'global' settings, then a good place to store them would be in a sub-key of HKEY_LOCAL_MACHINE\SOFTWARE\ANY-maze.
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T1015 |