I'm trying to use the following code to press a button on my other application: HWND ButtonHandle; if( (wnd = FindWindow(0, "Do you want to save?")) ) { ButtonHandle = FindWindowEx(wnd, 0, "SaveButton", "&Save"); SendMessage(wnd, WM_COMMAND, MAKEWORD(GetDlgCtrlID(ButtonHandle), BN_CLICKED ), (LPARAM)ButtonHandle); } It doesn't work. I tried passing different handles to MAKEWORD and to change the WPARM and LPARAM but nothing. Any ideas on how to click a button on another application's window? Code is appreciated. Thanks. EDIT: The reason it doesn't seem to work permissions. I sent a PostMessage