Sample: dhtmlxWindows User-Button dhtmlxWindows main page
X
Select Button
Select Action
 
<head>
    ...
    <!-- attach css containing user-button styles -->
    <link rel="stylesheet" type="text/css" href="codebase/skins/dhtmlxwindows_standard_userbtn_tray.css">
</head>
<script>
 
    var dhxWins = new dhtmlXWindows();
    ...
    // add "Tray" user-button
    dhxWins.window(id).addUserButton("tray", 0, "Move to Tray", "tray");
    // attach event to "Tray" button
    dhxWins.window(id).button("tray").attachEvent("onClick", function(){
        alert('user-button "Tray" was clicked');
    });
</script>