How to use a C++ API?

Asked

Viewed 526 times

1

I’ve been researching several websites that explain how to use an API, but for some reason I’m doing it wrong. I would like to know how to use the WM_PASTE Windows API to block Mouse Paste(Ctrl+v) on a Tcombobox. I am using Embarcadero C++ Builder.

  • What you’ve already done?

  • declared windows. h and tried to use some functions windows Procedure, but did not compile anything. made some statements in . h of my form as I had searched, but, n had result. I stopped there and thought: I’m doing everything wrong.

  • 2

1 answer

2


When you ask "How to use an API" you are asking for any API, as there are many such as Win32 API, Directx, Opengl and many others.

Did you mean how to use the Win32 API? Correct?

WM_PASTE is not an API but a build directive that is used as a constant in Win32 API which stands for hexadecimal 0x0302.

And apparently you are using another graphical API, so it is necessary to know the API you are using to know if it is possible to do this only with the API you are using. If you really need to use the Win32 API you will need to have access to the HWND (Handle Window) of the Tcombobox control which is the controller of the control, and access to the message loop of the program.

  • thanks a lot for the clarification. I’m just starting to study about windows Apis. so I’m still kind of lost where to start.

  • If that answer helped you, I could put it in the right answer, no?!

  • Even though your answer didn’t solve my problem, it cleared up some things and really helped me improve my research. and yes, my tool is a jossa. I only used it in view of my teacher’s request in the course. thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.