1. Vinicius Geraldino
  2. PowerBuilder
  3. Tuesday, 4 June 2024 18:51 PM UTC

Hello, im trying to use TrackMouseEvent winapi, but when i put the function on "Local External Functions":

Function boolean TrackMouseEvent ( &
	Ref TRACKMOUSEEVENT lpEventTrack &
	) Library "user32.dll"

Im getting error: Illegal data type TRACKMOUSEEVENT.

How do I create this type? TRACKMOUSEEVENT

 

Accepted Answer
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Wednesday, 5 June 2024 06:35 AM UTC
  2. PowerBuilder
  3. # Permalink

TRACKMOUSEEVENT is a structure, John already linked to the Winapi definition.

This is a possible implementation in PB:

global type trackmouseevent from structure
	unsignedlong		cbsize
	unsignedlong		dwflags
	unsignedlong		hwndtrack
	unsignedlong		dwhovertime
end type
Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 4 June 2024 19:16 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Vinicius -

If I may ask, what are you wanting to accomplish? There may be existing functionality in PowerBuilder that does what you need. Please also mention the version, release and build of PB that you are using. It would be helpful to also know the version of Windows being used and if your application will be deployed as a 32-bit or as a 64-bit application.

As to your question, the argument value to this Windows API function is a structure. Here are links to API documentation:

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-trackmouseevent

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-trackmouseevent

The first URL is for the TrackMouseEvent event, and the second URL is for the structure.

Please recognize that the Windows API documentation is written for C/C++ development and the API makes extensive use of typedef'd data types, so you'll need to translate everything into PowerBuilder/PowerScript equivalents.

Best regards, John

Comment
  1. John Fauss
  2. Tuesday, 4 June 2024 19:40 PM UTC
Roland Smith has a free code example on his TopWizProgramming web site that uses the TrackMouseEvent Windows API function:

https://www.topwizprogramming.com/freecode_dwgridxp.html

This sample application includes a feature highlights the label over a grid DataWindow column when the mouse is over it. Depending on your needs, you may find it helpful to refer to a working example that utilizes this API function.
  1. Helpful 3
  1. Vinicius Geraldino
  2. Wednesday, 5 June 2024 11:27 AM UTC
Hi John, i read the code example of TopWizProgramming and now i undestand.

In edit source, he creates a internal structure

type trackmouseevent from structure

unsignedlong cbsize

unsignedlong dwflags

unsignedlong hwndtrack

unsignedlong dwhovertime

end type



Now the function works, thanks for all who helped me!
  1. Helpful
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.