Need help with palette & TPaintBox

Does anyone have some sample Delphi source code that uses the Win API
functions to use a palette? I've been playing around with the palette
functions, but can't get them to work. Thanks in advance!