Replacement content

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 Trucchi di programmazione
 Internet-connessioni
 Tasti all'interno di un tcppwebbrowser
 Forum Locked
 Printer Friendly
Author  Topic Next Topic  

[Mamo]
Administrator

Italy
160 Posts

Posted - 05/05/2010 :  23:19:05  Show Profile  Visit [Mamo]'s Homepage
// in .h, sotto private:
void __fastcall ReturnMsgHandler(tagMSG &Msg, bool &Handled);
IOleInPlaceActiveObject *OleInPlaceActiveObject;


// in .cpp
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Application->OnMessage = ReturnMsgHandler;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ReturnMsgHandler(tagMSG &Msg, bool &Handled)
{
if (CppWebBrowser1 && (!CppWebBrowser1->Busy) &&
(Msg.message == WM_KEYDOWN || Msg.message == WM_KEYUP) &&
(Msg.wParam == VK_RETURN || Msg.wParam == VK_EXECUTE))
{
Handled = IsDialogMessage(CppWebBrowser1->Handle, &Msg);
if (Handled)
{
if (!OleInPlaceActiveObject)
{
CppWebBrowser1->Application->QueryInterface(
IID_IOleInPlaceActiveObject, (void **)&OleInPlaceActiveObject);
}
if (OleInPlaceActiveObject)
OleInPlaceActiveObject->TranslateAccelerator(&Msg);
}
}
else
Handled = false;
}
//---------------------------------------------------------------------------

[Mamo]
Administrator

Italy
160 Posts

Posted - 03/06/2010 :  21:22:12  Show Profile  Visit [Mamo]'s Homepage
e per aggiungere anche la funzione di copy del testo selezionato,
void __fastcall TForm1::FormCreate(TObject *Sender)
{
OleInitialize(NULL);
}

void __fastcall TForm1::FormDestroy(TObject *Sender)
{
OleUninitialize();
}
Go to Top of Page
   Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Ciemmesoft Forum © 2008 Ciemmesoft Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.05