Thanks for helping.. I had found how to use findwindow. The below code should pass the keys to ppviewer, but it is not passing. pls tell me whether the parameters are incorrect or its problem with send message.
#include "stdafx.h"
#include "windows.h"
#include "stdio.h"
#define VK_N 0x4E
#define VK_P 0x50
#define WN_KEYUP 0x0101
#define WN_KEYDOWN 0x0100
int _tmain(int argc, _TCHAR* argv[])
{
char c;
HWND hwnd;
hwnd=FindWindow(NULL,L"Powerpoint Viewer Slide Show - [Injection_Attacks.ppt]");
printf("\n caught handle now press p for previous slide and n for next slide");
while(1)
{
scanf("%c",&c);
switch(c)
{
case 'n':
SendMessage(hwnd, WM_KEYDOWN, VK_N, 0); flushall();
break;
case 'p':
SendMessage(hwnd, WM_KEYDOWN, VK_P, 0); flushall();
break;
default:
printf("enter n for next slide and p for previous slide");
break;
}
}
return 0;
}