MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Toolbar_GetButtons

Function Toolbar_GetButtons

src/Helpers.c:786–803  ·  view source on GitHub ↗

============================================================================= Toolbar_Get/SetButtons()

Source from the content-addressed store, hash-verified

784// Toolbar_Get/SetButtons()
785//
786int Toolbar_GetButtons ( HWND hwnd, int cmdBase, LPWSTR lpszButtons, int cchButtons )
787{
788 WCHAR tchButtons[512];
789 WCHAR tchItem[32];
790 int i, c;
791 TBBUTTON tbb;
792 lstrcpy ( tchButtons, L"" );
793 c = min ( 50, ( int ) SendMessage ( hwnd, TB_BUTTONCOUNT, 0, 0 ) );
794 for ( i = 0; i < c; i++ ) {
795 SendMessage ( hwnd, TB_GETBUTTON, ( WPARAM ) i, ( LPARAM ) &tbb );
796 wsprintf ( tchItem, L"%i ",
797 ( tbb.idCommand == 0 ) ? 0 : tbb.idCommand - cmdBase + 1 );
798 lstrcat ( tchButtons, tchItem );
799 }
800 TrimString ( tchButtons );
801 lstrcpyn ( lpszButtons, tchButtons, cchButtons );
802 return ( c );
803}
804
805int Toolbar_SetButtons ( HWND hwnd, int cmdBase, LPCWSTR lpszButtons, LPCTBBUTTON ptbb, int ctbb )
806{

Callers 2

MsgThemeChangedFunction · 0.85
SaveSettingsFunction · 0.85

Calls 1

TrimStringFunction · 0.85

Tested by

no test coverage detected