In the PDF reader, we switch to the next page with the right arrow button. In my own winforms application, I assigned the right arrow key to the global hotkey and when I press the right arrow key it says "hello world" for trial purposes.
In this case, when I open the PDF reader and press the right arrow, it says "hello world" but it does not switch to the next pages. I want that when I press the right arrow button on the PDF reader, both switch to the next pages and say "hello world" because of the global hotkey assignment in my own winform application.
When I searched on Google, I couldn't find an article about such a situation. How can I achieve this?
Based on Jimi's example:
public YourClass()
{
InitializeComponent();
//const int id = 0; // The id of the hotkey.
// For eaxple hot key F5
RegisterHotKey(Handle, 0, (int)KeyModifier.None, Keys.F5.GetHashCode());
}
protected override void WndProc(ref Message message)
{
base.WndProc(ref message);
if (message.Msg == 0x0312)
{
var id = message.WParam.ToInt32();
if (id == 0)
{
/*
* Write a method hee what you want to do.
*/
// Let the command press the right arraybotton instead.
SendKeys.SendWait("{RIGHT}");
}
}
}