Home > database >  Pb no callback function? PB how to use the EnumChildWindows traversal get another application window
Pb no callback function? PB how to use the EnumChildWindows traversal get another application window

Time:09-22

Have got the handle to the window, use the
L_handle=guo_sendtext. FindWindowA (0, ls_wname)
Ls_temp=sle_1. Text
The Clipboard (ls_temp)
Guo_sendtext. SendMessage (3213642, guo_sendtext. WM_PASTE, 1, ' ')//can send characters successfully into the target text box

3213642 is through the text box handle spy++,
Because of that window has multiple text input box, and the handle is also dynamic change,

CodePudding user response:

The callback function.
Application window handle can be obtained through the API.
//about the Windows API operation
//get the program's main window according to the process
The Function ulong GetProcessWindow_local (ulong processid) Library "user32. DLL" alias for "GetProcessWindow
"//according to the process window for
SUBROUTINE GetWindowThreadProcessId_local (ulong HWND, ref ulong pid) Library "user32. DLL" alias for "GetWindowThreadProcessId
"The Function ulong FindWindowA_local (String lpClassName, String lpWindowName) Library "user32. DLL" alias for "FindWindowA
"The Function Long SetWindowPos_local (Long HWND, Long word, Long px, Long py, Long dx, Long dy, Long uflag) Library "user32. DLL" alias for "SetWindowPos
"The Function int GetClassName_local (ulong hWnd, ref string lpClassName, int nMaxCount) library "user32" alias for "GetClassNameA
"The function long GetWindowText_local (long HWND, ref string lpString, long nMaxCount) library "user32" alias for "GetWindowTextA
"The function long SetWindowText_local (long HWND, string lpString) library "user32" alias for "SetWindowTextA
"The Function ulong FindWindow_Handle_local (ulong lpClassName, String lpWindowName) Library "user32. DLL" alias for "FindWindowW
"The Function ulong FindWindowEx_local (ulong hWnd1, ulong hWnd2, String lpClassName, String lpsz2) Library "user32" Alias for "FindWindowExA
"The Function Ulong FindWindowByWindowName_local (String lp_WindowName) Library "user32" Alias for "FindWindowByWindowNameA
"The function ulong GetWindow_local (ulong hwindow, int nrelationship) library "user32. DLL" alias for "GetWindow
"//return the window to its original position
SUBROUTINE SwitchToThisWindow_local (Long hWnd, Boolean fAltTab) Library "user32. DLL" alias for "SwitchToThisWindow
"//get specified window
The Function ulong GetWindow_local (ulong hWd, ulong ul_wm_message) Library "user32. DLL" alias for "GetWindow
"The FUNCTION ulong lstrcat_local (ref string lpString1, ref string lpString2) LIBRARY "kernel32. DLL" ALIAS FOR "lstrcatA
"The FUNCTION ulong lstrcmp_local (ref string lpString1, ref string lpString2) LIBRARY "kernel32. DLL" ALIAS FOR "lstrcmpA
"The FUNCTION ulong lstrcmpi_local (ref string lpString1, ref string lpString2) LIBRARY "kernel32. DLL" ALIAS FOR "lstrcmpiA
"The FUNCTION ulong lstrcpy_local (ref string lpString1, ref string lpString2) LIBRARY "kernel32. DLL" ALIAS FOR "lstrcpyA
"The FUNCTION ulong lstrcpyn_local (ref string lpString1, ref string lpString2, ulong iMaxLength) LIBRARY "kernel32. DLL" ALIAS FOR "lstrcpynA
"The FUNCTION ulong lstrlen_local (ref string lpString) LIBRARY "kernel32. DLL" ALIAS FOR "lstrlenA
"The Function long StrCopy_local (long Destination, REF string Source, long Size) library "kernel32. DLL" Alias for "RtlMoveMemory
"The Function long LocalAlloc_local (long Flags, long Bytes) library "kernel32. DLL" alias for "GetProcessWindow
"The Function long LocalFree_local (long MemHandle) library "kernel32. DLL
"The FUNCTION ulong MapVirtualKeyA_local (UINT uCode, UINT uMapType) Library "user32. DLL" alias for "MapVirtualKeyA
"//to clipboard function
The FUNCTION Boolean OpenClipboard_local (UINT hWndNewOwner) Library "user32. DLL" alias for "OpenClipboard
"The FUNCTION Boolean EmptyClipboard_local () Library "user32. DLL" alias for "EmptyClipboard
"The FUNCTION Boolean CloseClipboard_local () Library "user32. DLL" alias for "CloseClipboard."

CodePudding user response:

Give the building Lord or a process instance is not? Don't appreciate, knot posted immediately!

CodePudding user response:

Inquire how to traverse the window controls in the PB stick son, should be able to help you

CodePudding user response:

If is a function of the sheet can use pb itself,
If the API using findwindow function in general

CodePudding user response:

How do I realize: IF the checkbox checked THEN the database table to add a line, and add a field in the second column (value), thank you!
reference 1st floor response:
no callback function.
Application window handle can be obtained through the API.
//about the Windows API operation
//get the program's main window according to the process
The Function ulong GetProcessWindow_local (ulong processid) Library "user32. DLL" alias for "GetProcessWindow
"//according to the process window for
SUBROUTINE GetWindo...
  • Related