I assume that you have set up for handling the button event in the second dialog.
In this event all you have to do is to send the message to the button in the first page. This can be done by:
SendMessage(WM_COMMAND,
MAKEWPARAM(IDC_MY_FIRST_BUTTON, BN_CLICKED),
(LPARAM) m_MyFirstButton.m_hWnd);