Ver Mensaje Individual
  #3  
Antiguo 10-04-2016
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola aguml.

Fijate si te sirve esta propuesta.

.h
Código PHP:
...
class 
TForm1 : public TForm
{
__published:
  
TComboBox *ComboBox1;
  
TStatusBar *StatusBar1;
  
void __fastcall FormCreate(TObject *Sender);
private:
  
void __fastcall AppIdle(TObject *Sender, bool &done);
public:
  
__fastcall TForm1(TComponent* Owner);
};
... 
.cpp
Código PHP:
...
void __fastcall TForm1::AppIdle(TObject *Sender, bool &done)
{
  
TPoint pt;
  
HWND HWL;

  
GetCursorPos( &pt );
  
HWL = WindowFromPoint( pt );

  if ( 
HWL != 0 )
  {
    
StatusBar1->SimpleText = "";
    
char buff[128];
    
GetClassName( HWL, buff, sizeof( buff ) );
    if ( 
StrIComp( buff, "ComboLBox" ) == 0 )
    {
      ::
ScreenToClient( HWL, &pt );
      
int inx = LOWORD( SendMessage( HWL, LB_ITEMFROMPOINT, 0,
        (
LPARAM)(pt.y * 65535 + pt.x)) );

      if ( 
inx >= 0 )
        
StatusBar1->SimpleText = IntToStr(inx) + " " +
          
ComboBox1->Items->Strings[inx];
    }
  }
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
Application->OnIdle = AppIdle;
  
ComboBox1->Items->CommaText =
    
"cero,uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve";
  
ComboBox1->DropDownCount = 10;
}
... 
Salida:


Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita