I am trying to write a C code on windows to send cntrol C signal to a running, so that the running application closes gracefully.
Here is the code I have tried to write:
Code:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include <windows.h>
void main()
{
int i=0;
HWND h = NULL;
h = FindWindow(NULL,"RUNNING EXE");
printf("[%d]\n",h);
i = SendMessage(h,WM_CHAR,0x03,0);
printf("[%d]\n",i);
}
Waiting for a quick response.
Regards.

