アクティブなウィンドウから選択したテキストを取得してコンソールに出力しようとしている以下のコードがあります。
DWORD new12=0;
KEYBDINPUT* input = new KEYBDINPUT[key_count];
if( GetGUIThreadInfo( new12, lpgui ) )
{
target_window = lpgui->hwndFocus;
}
else
{
// You can get more information on why the function failed by calling
// the win32 function, GetLastError().
std::cout<<"error1";
}
// We're sending two keys CONTROL and 'V'. Since keydown and keyup are two
// seperate messages, we multiply that number by two.
for( int i = 0; i < key_count; i++ )
{
input[i].dwFlags = 0;
//input[i].type = INPUT_KEYBOARD;
}
input[0].wVk = VK_CONTROL;
input[0].wScan = MapVirtualKey( VK_CONTROL, MAPVK_VK_TO_VSC );
input[1].wVk = 0x56; // Virtual key code for 'v'
input[1].wScan = MapVirtualKey( 0x56, MAPVK_VK_TO_VSC );
私は上記の C++ コードを持っていますがerror: MAPVK_VK_TO_VSC' was not declared in this scope
、行input[0].wScan = MapVirtualKey( VK_CONTROL, MAPVK_VK_TO_VSC );
に " " というエラーが表示されているようです。ここで何が問題なのだろうか。宣言の問題が原因でこのエラーがポップアップしているとは思いません。ここで私を助けてくれませんか?ありがとうございました。