Skip to content
This repository was archived by the owner on Apr 27, 2023. It is now read-only.
This repository was archived by the owner on Apr 27, 2023. It is now read-only.

UCL.QuickButton question #6

@srd-software

Description

@srd-software

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions