Hi, João . ok, I use: HWND Hbutton = GetDlgItem(ptrDlg->m_hWnd,IDOK); SendMessage (Hbutton,BM_CLICK,0,0); from my thread and it works. Another question: if I want to send it from the same dialog window (for example from other button), How can I get the handle to the button? Well, I test the following: SendDlgItemMessage(IDC_GPS,BM_CLICK, 0, 0 ); from the same dialog and it works. Thanks Regards, Javier