SVC ADD PREFERENCES CONTROL
From LIVECHAT Developer Zone Wiki
- SVC_ADD_PREFERENCES_CONTROL
- Add a preferences control item.
- Parameters
- wParam
- NULL
- lParam
- LCPREFERENCESITEM* item
Return values
- Returns API_ERROR if operation failed otherwise API_SUCCESS
Remarks
If item already exists it is updated.
Sample code
Title control:
LCPREFERENCESITEM control = {0};
control.cbSize = sizeof(LCPREFERENCESITEM);
control.page_id = 100;
control.plugin_name = name();
control.id = 1000;
control.type = PREFERENCES_TITLE;
control.caption = _T("Sample title");
control.icon = LoadIcon(mInstance ,MAKEINTRESOURCE(IDI_ICON1));
control.style = NO_TOP_MARGIN;
call(SVC_ADD_PREFERENCES_CONTROL, 0, (LPARAM) &control);
Edit control:
LCPREFERENCESITEM control = {0};
control.cbSize = sizeof(LCPREFERENCESITEM);
control.page_id = 100;
control.plugin_name = name();
control.id = 1001;
control.type = PREFERENCES_EDIT;
control.caption = _T("Sample edit control");
control.icon = LoadIcon(mInstance ,MAKEINTRESOURCE(IDI_ICON1));
call(SVC_ADD_PREFERENCES_CONTROL, 0, (LPARAM) &control);
Radio buttons control:
LCPREFERENCESITEM control = {0};
control.cbSize = sizeof(LCPREFERENCESITEM);
control.page_id = 100;
control.plugin_name = name();
control.id = 1002;
control.type = PREFERENCES_RADIO;
control.caption = _T("Sample radio buttons control");
control.icon = LoadIcon(mInstance ,MAKEINTRESOURCE(IDI_ICON1));
control.style = 3; //3 radio buttons
call(SVC_ADD_PREFERENCES_CONTROL, 0, (LPARAM) &control);
Link control:
LCPREFERENCESITEM control = {0};
control.cbSize = sizeof(LCPREFERENCESITEM);
control.page_id = 100;
control.plugin_name = name();
control.id = 1003;
control.type = PREFERENCES_LINK;
control.caption = _T("Sample link");
control.icon = LoadIcon(mInstance ,MAKEINTRESOURCE(IDI_ICON1));
control.service = _T("OnLinkClick");
call(SVC_ADD_PREFERENCES_CONTROL, 0, (LPARAM) &control);
