I have the handle of that window to which i wanted to send the message. I have also found that the PostMessage API which has same parameters as that of SendMessage ,is working fine. Declared this above in code [DllImport("user32.dll",EnteryPoint="PostMessage"] public static extern bool PostMessage(int hwnd,int msg,int wparam,int lparam) [DllImport("user32.dll",EnteryPoint="SendMessage"] public static extern int SendMessage(int hwnd,int msg,int wparam,int lparam) I am transferribg same parameters to the PostMessage and SendMessage by declaring them public ,on two different button_click event on my form Button with a PostMessage is working fine.But button_click with SendMessage is not working at all.I am not getting any warning, error or runtime errror. Also found that WM_KILLFOCUS,WM_QUIT are not working on PostMessage.However WM_CLOSE ,WM_KEYDOWN,WM_KEYUP worked fine. I do not know whats wrong(sure not coding).Please suggest. And I also want to know whic among SendMessage and PostMessage is more reliable