L
L
likilix2018-07-05 16:10:24
Delphi
likilix, 2018-07-05 16:10:24

Why does the application hang when processing the WM_LBUTTONUP/WM_RBUTTONUP message?

I am using C++BuilderXE

class TRailwayMap : public TCustomControl
   {
       typedef TCustomControl Inherited;

    protected:
       BEGIN_MESSAGE_MAP
         MESSAGE_HANDLER(WM_RBUTTONUP, TWMRButtonUp, RmRMouseUp);
         MESSAGE_HANDLER(WM_LBUTTONUP, TWMLButtonUp, RmLMouseUp);
       END_MESSAGE_MAP(Inherited);

   void __fastcall CreateWnd(void)
   {
     Inherited::CreateWnd();
   }
    void __fastcall RmRMouseUp(Messages::TWMRButtonUp &Message) {
      
    }

    void __fastcall RmLMouseUp(Messages::TWMLButtonUp &Message) {
      
    }

    __fastcall TRailwayMap::TRailwayMap(Classes::TComponent* AOwner)
    	 : Inherited(AOwner)
    {

    }

   };
  // Код находится в конструкторе главной формы
  
   RailwayMap = new TRailwayMap(this);
   RailwayMap->Align = alClient;
   RailwayMap->Parent = this;

If you click on the component several times in a row, the form freezes. If you add ReleaseCapture() to the handler; then no hangup occurs. Is it possible to somehow get rid of this problem without adding ReleaseCapture(); ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question