All you have to do is check if the mouse cursor is in a specific set of coordinates. I made this a while back:
bool CreateButton(int iTopLeftCornerX, int iTopLeftCornerY, int iBottomLeftCornerX, int iBottomLeftCornerY, int iTopRightCornerX, int iTopRightCornerY, int iBottomRightCornerX, int iBottomRightCornerY, char* szText)
{
bool bPressed = 0;
int iTextPosX, iTextPosY;
iTextPosX = ((iTopLeftCornerX + iBottomRightCornerX) / 2);
iTextPosY = ((iTopLeftCornerY + iBottomRightCornerY) / 2);
dbText(iTextPosX, iTextPosY, szText);
if (dbMouseClick() == 1 && dbMouseX() > iTopLeftCornerX && dbMouseY() > iTopLeftCornerY && dbMouseX() > iBottomLeftCornerX && dbMouseY() < iBottomLeftCornerY && dbMouseX() < iTopRightCornerX && dbMouseY() > iTopRightCornerY && dbMouseX() < iBottomRightCornerX && dbMouseY() < iBottomRightCornerY)
{
bPressed = 1;
}
else
{
bPressed = 0;
}
return bPressed;
}
Put that in an IF statment in your main loop like this:
if(CreateButton(iTopLeftCornerX,iTopLeftCornerY,iBottomLeftCornerX, iBottomLeftCornerY, iTopRightCornerX, iTopRightCornerY, iBottomRightCornerX, iBottomRightCornerY, szText) == 1)
Where the integers iTopCorner, iBottomCorner, etc are the positions of each corner on the button in pixels, and szText is the text on the button. It will return a 1 if the button is pressed. This could easily adapted to use sprites and would be easier to make.