ん?うまくいってるでしょ。LBN_KILLFOCUSの値になってるんじゃないかな

require '_frm_hogehoge'
module WMsg
  LBN_SETFOCUS = 4
  LBN_KILLFOCUS = 5
end
class Form1                                                        ##__BY_FDVR
  def self_created
    @listBox1.addCommandHandler(WMsg::LBN_DBLCLK, "dblclicked",MSGTYPE::ARGNONE,nil)
    @listBox1.addCommandHandler(WMsg::LBN_SETFOCUS, "gotfocus",MSGTYPE::ARGNONE,nil)
    @listBox1.addCommandHandler(WMsg::LBN_KILLFOCUS, "lostfocus",MSGTYPE::ARGNONE,nil)
    @listBox1.addString('みかん')
    @listBox1.addString('りんご')
  end
 
  def listBox1_dblclicked
    puts @listBox1.getTextOf(@listBox1.selectedIndex)
  end
 
  def listBox1_gotfocus; puts "gotfocus"; end
  def listBox1_lostfocus; puts "lostfocus"; end
end                                                                ##__BY_FDVR