Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 01-10-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Poder: 22
cHackAll Va por buen camino
Código Delphi [-]
//...

uses ActiveX, ComObj, RichEdit;

//...

type
 IRichEditOle = interface(IUnknown)
  ['{00020d00-0000-0000-c000-000000000046}']
  function GetClientSite(out clientSite: IOleClientSite): HRESULT; stdcall;
  function GetObjectCount: HRESULT; stdcall;
  function GetLinkCount: HRESULT; stdcall;
  function GetObject(iob: Integer; out ReObject; dwFlags: Cardinal): HRESULT; stdcall;
 end; // changed !!!

procedure TForm1.JvRichEdit1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

var
 RichEdit: TCustomMemo;
 Point: TPoint;
 Value, Index: Integer;
 RichEditOle: IRichEditOle;
 ReObject: record
  cbStruct, cp: Cardinal;
  clsid: TCLSID;
  poleobj: IOleObject;
  pstg: IStorage;
  polesite: IOleClientSite;
  sizel: TSize;
  dvAspect: Integer;
  dwFlags, dwUser: Cardinal;
 end;

begin
 if (Button = mbLeft) and (Sender is TCustomMemo) then
  begin
   RichEdit := Sender as TCustomMemo;
   if RichEdit.SelLength = 1 then
    begin
     Windows.GetCaretPos(Point);
     Value := RichEdit.Perform(EM_CHARFROMPOS, 0, Integer(@Point)) - 1;
     if Value >= 0 then
      begin
       SendMessage(RichEdit.Handle, EM_GETOLEINTERFACE, 0, Integer(@RichEditOle));
       ReObject.cbStruct := SizeOf(ReObject);
       for Index := 0 to RichEditOle.GetObjectCount - 1 do
        begin
         RichEditOle.GetObject(Index, ReObject, 0{REO_GETOBJ_NO_INTERFACES});
         if Integer(ReObject.cp) = Value then // 0j0: funciona con cualquier objeto!
          begin
           ShowMessage('Object ID: ' + IntToStr(Index)); // aquí haces lo que debes hacer...
           RichEdit.SelLength := 0;
           Break;
          end;
        end;
      end;
    end;
  end;
end;

Nota; considerar que en las pruebas se utilizó un componente JEDI, sin embargo debiese funcionar con cualquier componente que utilice interfaces OLE estándares .

Saludos
__________________
RTFM > STFW > Foro > Truco > Post > cHackAll > KeBugCheckEx
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ligado / Interconexión de dos BD/Sesiones _Willa Firebird e Interbase 11 28-06-2007 14:47:02
Imprimir RichText con QReports Fita Impresión 0 05-05-2007 18:21:22
Reemplazar en un RichText User_Baja_2 Varios 1 12-06-2005 12:56:07
Formatear cadena numérica a la derecha dentro de un richtext cesargcman Varios 1 09-05-2004 18:45:53
modificar dbgrid ligado a query squenda Conexión con bases de datos 7 25-04-2004 06:54:03


La franja horaria es GMT +2. Ahora son las 22:13:37.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi