I can only show you how to do it in API not borlands library. Perhaps you had better wait for a borland afficionado.
btw. this is really windows programming, we have a board for the purpose.