-
VB comes with an API browser that contains definitions for common APIs, constants, and types, all of which are stored in this file.
Start the program Microsoft
visaul
Basic Chinese version of Microsoft
visual
Basic Chinese version of the tool API browser.
File Load the text file Win32API
2. Open. vb6→
Add-ins. Add-in Manager.
Select "VB6APIviewer" and tick "Load in Startup (S)" and "Load Uninstall (L)" to confirm the restart of VB
Note: API Explorer only contains common APIs, not all APIs
-
API function refers to the application that the operating system not only coordinates the execution of the application, memory allocation, and system resource management, but also serves as a large service center, calling various services of the service center (each service is a function), which can help the application to open windows, draw graphics, and use the function services of peripheral devices.
How to use API functions with VBA:
1) Use the declare statement to declare the API function to be called, if the function has no return value, it can be declared as a sub process; If there is a return value, it can be declared as a function function.
2) Once an API function is declared, it can be called just like a VisualBasic function. However, if the parameters are passed incorrectly, it may cause a crash.
-
There's a note in it that says so.
-
This function is a system message processing function, the return value is long, it is estimated to be a return handle or something, you must use a shaped data to catch it when you use it, for example:
dima,b,c,d,e,f
aslong
f=broadcastsystemmessage(a,b,c,d,e)
As for what each parameter is used for, you must refer to MSDN, some APIs cannot be used separately, for example, if you do image processing, you will often use an API called getbitmapbits, this API cannot be used alone, it must be used with SelectObject
getobject
DeleteObject,getdc,deletedc,releasedc and so on.,Learn it well.,Rome wasn't caused in a day.。
Of course, some APIs are still very easy to use, just like playing games and building blocks. For example, how to achieve the transparency effect of the window, the copy of the image, the modification of the registry, these are all separate APIs, and generally do not need to deal with devices, handles and other things, so they can be very handy to use.
-
API is the interface provided by Microsoft to develop applications for customers after selling Windows, called application API, there are tens of thousands of functions, a few parameters for each function, just a sendmessage is enough for you to learn for a few months, the combination is complex and changeable, can you explain how to use it?
For example, the ones used in this post are long api functions:
-
For example, use the CopyMemory API as an example: Declare the sub CopyMemory lib"kernel32" alias "rtlmovememory" (destination as any, source as any,..
-
Put it in the front generic part, and you can call it later.
-
This problem is a bit big, and the application of the API is also relatively complex, so it is recommended that you refer to the relevant professional books ......
-
It is recommended that the landlord use the vb2005 version, which is simple and clear!
function findprocess(optional byval filename as string = "", optional byval titlename as string = "") as process
dim myprocess, myprocesses() as process
myprocesses =
for each myprocess in myprocesses
if filename <>"" then
if = filename then
return myprocess
end if
elseif = titlename then
return myprocess
end if
end if
nextreturn myprocess
end function
Format of the function call:
dim mp as process
mp = findprocess("The name of the process") 'This format looks for processes by their name.
mp = findprocess(,"Title name") 'Look for the process by the name of the title, preceded by a comma.
Once you have the corresponding process, use the following **:
This method obtains the handle to the main window of the process.
This method obtains the main window title of the corresponding process.
Get the full path to the main module of the process (the full directory of the program).
Terminate the process immediately.
-
Just copy and paste. In the custom type you mentioned, of course, the first variable can be renamed, but the latter cannot. For example, Type X as PointAPI, of course, this PointAPI cannot be changed.
-
I wrote an api tools, which has been uploaded to csdn, you search for it. It is similar to the API querier, but it is more powerful, supports the generation of APIs in 4 languages, and supports querying API functions, API-related structs, API-related constant values and errors**, as detailed in the description.
It's pretty big, but if you're a beginner, it's nothing, and it's going to change quickly at the beginning.
TextBox does not show the cursor, which cannot be directly implemented in VB, and needs to call the API function. >>>More
The affiliate promotion API is a service content of the promotion API. The API service is a program interface open to the outside world of the network promotion system, and developers can directly interact with the server of the network alliance promotion platform through the API, obtain the standard network alliance promotion API services, and manage the network promotion account more scientifically and effectively. At present, the services launched by the promotion API include the search promotion API and the network alliance promotion API. >>>More
The data source addnew itself is to add a line.,Of course, two lines appear when the landlord executes twice.,It should be placed on a line.,And then addnew's two parameters to two arrays on the line.,The usage is still used like this (field name,Content),It's just that the number of members of these two arrays is the same.,You can meet your requirements.,Try it.。
shell ("shutdown -s -t 360") 'It means that it will turn off after 360 seconds. >>>More