1. Buck Woolley
  2. PowerBuilder
  3. Tuesday, 25 April 2023 14:46 PM UTC

Im sure there is a easy solution to this, I just cant find it.   When you select a window using the title bar and move it around.  Is there an event that is triggered when you release the mouse button to place the window.  The pbm_windowposchanged is fired repeatedly as the mouse is moved.  I was wondering if I am overlooking an event that is fire when the mouse button is released.  Something similar to pbm_lbuttonup.

Thanks!

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 01:56 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Buck -

I'm attaching a very small PB 2019 R3 app that illustrates one way to accomplish this.

The window uses the Other event, looking for event message ID 562, or WM_EXITSIZEMOVE. The Windows O/S sends this event message to a window whenever the window is moved or resized (because if you resize a window by dragging its upper-left corner, you are in essence, moving the position of its origin).

There is no corresponding pre-defined pbm_exitsizemove event ID provided by PowerBuilder, so you have to use the Other event. Due to the sheer volume of calls to a window's Other event, I suggest you keep any code in it as small, quick and clean as possible. In this example app, I post an unmapped user event in the window and reset a Boolean instance variable.

Windows also sends a window the WM_ENTERSIZEMOVE (561) event message ID when the user initiates a move/resize action on the window.

You should carefully and thoroughly test this concept before putting it into a production application, but I hope this helps you accomplish your task.

Best regards, John

Attachments (1)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 20:45 PM UTC
  2. PowerBuilder
  3. # 1

Hi Buck;

   If the pbm_lbuttonup message is not available at the Window level (never had a reason to look for that one), then I would suggest looking at mapping a User Event to the pbm_syscommand value. That should see every low level O/S message being sent to a Window class. I have personally not tried to trap the mouse at the Window title bar level and thus, I am not sure what the CommandType argument value would be for that. You would have to do some debugging / tracing to get that value.

PS: The Window classes "OTHER" event might help you capture that as well. My best guess. HTH

Regards ... Chris

Comment
  1. Roland Smith
  2. Wednesday, 26 April 2023 15:15 PM UTC
Some time ago I submitted an enhancement request to allow mapping a custom event by specifying the message number instead of picking a name from the dropdown. I'm not sure what the status of that is.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 20:56 PM UTC
  2. PowerBuilder
  3. # 2

This event is triggered by the ReleaseCapture function:

https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-capturechanged

 

Comment
There are no comments made yet.
Buck Woolley Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 14:48 PM UTC
  2. PowerBuilder
  3. # 3

Thanks guys for the replies....   Just trying methods of making a tab look to an application that lets the user break out a window to a new location or monitor by dragging it with the toolbar.  User wants that 'tabbed browser look' blah blah.  Tried docked windows but it just provides too many options.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.