Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a VBA syntax example #1489

Open
wants to merge 1 commit into
base: docs
Choose a base branch
from
Open

Conversation

JamieG-UK
Copy link

Because VBA cannot pass the pt argument ByVal using the POINTAPI structure, it has to pass it inline. There are a lot of incorrect examples online so clarifying this here would be great. This is the correct VBA declaration:

Declare PtrSafe Function MonitorFromPoint Lib "user32.dll" ( _
ByVal X As Long, _
ByVal Y As Long, _
ByVal dwFlags As Long) As LongPtr

Because VBA cannot pass the pt argument ByVal using the POINTAPI structure, it has to pass it inline. There are a lot of incorrect examples online so clarifying this here would be great. This is the correct VBA declaration:

Declare PtrSafe Function MonitorFromPoint Lib "user32.dll" ( _
                                               ByVal X As Long, _
                                               ByVal Y As Long, _
                                               ByVal dwFlags As Long) As LongPtr
@prmerger-automator
Copy link

@JamieG-UK : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants