CToolbar.AddStringmethod
Adds a new string to the toolbar's string pool.
Syntax
FUNCTION AddString (BYVAL hToolbar AS HWND, BYVAL hInst AS HINSTANCE, BYVAL idString AS INT_PTR) AS LONG
Parameters
| Name | Description | |
|---|---|---|
hToolbar | Handle to the toolbar control. | |
hInst | Handle to the module instance with an executable file that contains the string resource. If idString instead points to a character array with one or more strings, set this parameter to NULL. | |
idString | Resource identifier for the string resource, or a pointer to an array of characters. See Remarks. |
Return value
Returns the index of the first new string if successful, or -1 otherwise.
Description
Adds a new string to the toolbar's string pool.
Remarks
If hInst is NULL, idString points to a character array with one or more null-terminated strings. The last string in the array must be terminated with two null characters.
If hInst is the HINSTANCE of the application or of another module containing a string resource, idString is the resource identifier of the string. Each item in the string must begin with an arbitrary separator character, and the string must end with two such characters. For example, the text for three buttons might appear in the string table as "/New/Open/Save//". The message returns the index of "New" in the toolbar's string pool, and the other items are in consecutive positions.
Reference
- Include file
CToolbar.inc - Defined in AfxNova/CToolbar.inc:309
- Documented in Windows/WIndows Controls/CToolbar Class.md
- Topic: CToolbar Class