現在アクティブのメモの内容をCtrl+Qでゲットするプログラムを
書いたつもりなのですが、ゲットしてきてくれません。
助言ください。
__fastcall TForm1::TForm1(TComponent* Owner)  : TForm(Owner){
 RegisterHotKey(Handle, 0x0000, MOD_CONTROL, 'Q');
}
void __fastcall TForm1::FormDestroy(TObject *Sender){
 UnregisterHotKey(Handle, 0x0000);
}
HWND __fastcall GetActiveInput(){
 HWND h; DWORD pid;
 DWORD tid = GetWindowThreadProcessId(GetForegroundWindow(), &pid);
 if ( AttachThreadInput(GetCurrentThreadId(), tid, true) ){
  h = GetFocus();
  AttachThreadInput(GetCurrentThreadId(), tid, false);
 }else
  h = GetFocus();
 return h;
}
void __fastcall TForm1::WMHotKey(TMessage & Msg){
 if(MAKELPARAM(MOD_CONTROL,'Q') == Msg.LParam){
  HWND hwnd = GetActiveInput();
  std::vector<char> buffer(GetWindowTextLength(hwnd) + 1);
  // 持ってくる
  GetWindowText(hwnd, &buffer[0], buffer.size());
  // 設定する
  SetWindowText(Memo1->Handle, &buffer[0]);
 }
}