DelphiUCL icon indicating copy to clipboard operation
DelphiUCL copied to clipboard

UCL.QuickButton question

Open srd-software opened this issue 4 years ago • 1 comments

Would it be possible to use SendMessage instead of WindowState in the Wm_LButtonUp proc? So instead of this:

            qbsMax:
              if not FullScreen then
                begin
                    ParentForm.WindowState := wsNormal
                  else
                    ParentForm.WindowState := wsMaximized;
                end;

Go to something like this:

            qbsMax:
              if not FullScreen then
                begin
                  ReleaseCapture;
                  if ParentForm.WindowState <> wsNormal then
                    SendMessage(ParentForm.Handle,WM_SYSCOMMAND,SC_RESTORE,0)
                  else
                    SendMessage(ParentForm.Handle,WM_SYSCOMMAND,SC_MAXIMIZE,0);
                end;

I sometimes need to intercept the window restore/max messages in my app and if the button uses WIndowState I can't seem to do that.

I was able to work around it by setting the button's ButtonStyle from qbsMax to qbsNone and then add code to the button's MouseUp. But maybe there's a reason for using WindowState?

Thanks. Not a big deal but thought I'd ask about it.

srd-software avatar Apr 04 '20 15:04 srd-software

Incorrect «List button» buttons at 200% Screenshot2

SnowSonic avatar May 25 '20 10:05 SnowSonic