AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones varias de Windows
  • Example: Calling a function of the Windows API with Callback
CallDLL32 (Example)
Example: Calling a function of the Windows API with Callback
The following example is used to implement a trace file containing all the identifiers (handles) of the windows currently opened on the current computer.
The StartATrace procedure opens the trace file and lists the windows via the ListWindows function of the User32 API.
The EnumerateWindow procedure is called by the EnumWindows function of the User32 API whenever a window is found. This procedure is used to write the identifier of the window found into the trace file.
PROCEDURE StartATrace()
// Open file
nFile is int = fOpen("C:\WindowHandle.txt", foCreate)
IF nFile = -1 THEN
Error("Problem with the file")
EndProgram()
END
// Start the enumeration
CallDLL32("User32", "EnumWindows", &EnumerateWindow, nFile)
// Close the file
fClose(nFile)
PROCEDURE EnumerateWindow(nHwnd is int, nFile is int)
// Write into the file
fWriteLine(nFile, nHwnd)
RETURN True
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local