Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (214 - 216 of 3870)

Ticket Resolution Summary Owner Reporter
#529 Completed Identifying .NET controls using WM_GETCONTROLNAME Jon zfisherdrums
Description

Having read previous request and response for DataGrid on ticket #23, I do not wish to beleaguer the point. Nor is it my place to specifiy what is/is not trivial to accommodate into AutoIT. However, with all the requests for persistent .NET control identification, I wonder what is the possibility of utilizing the "WM_GETCONTROLNAME" message either natively or in a standard UDF.

I enclose the following MSDN code only to provide some fruits of my "research" on this, and my failed attempt to port it into a UDF:

/*
given an hWnd, this code attempts to send a message to the window to get the
instance name of the control bound to the window
Steps:
1. Get the Value of the WM_GETCONTROLNAME message (RegisterWindowMessage)
2. Get the Process Info for this window (GetWindowThreadProcessId)
3. Open the process and get a process handle (OpenProcess)
4. Allocate memory within the target process (VirtualAllocEx)
5. Send the target window a WM_GETCONTROLNAME message and a pointer to the
memory (SendMessageTimeout)
6. Read the response from the allocated memory (ReadProcessMemory)
7. Close process handle, release memory
*/
//we enter this code with hwnd set to a specific window handle
//error checking omitted for brevity

const int bufsize = 1024;
wchar_t CtlName[bufsize];
DWORD ProcessId;
SIZE_T NumRead;

unsigned int GetName = RegisterWindowMessage(L"WM_GETCONTROLNAME");
DWORD dwResult = GetWindowThreadProcessId(hwnd, &ProcessId);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,false,ProcessId);
LPVOID OtherMem = VirtualAllocEx(hProcess, 0, bufsize, MEM_COMMIT,PAGE_READWRITE);
LPARAM lpOtherMem = reinterpret_cast<LPARAM>(OtherMem);
unsigned int SendFlags = SMTO_ABORTIFHUNG|SMTO_BLOCK;
LRESULT lResult = SendMessageTimeout(hwnd, GetName, bufsize, lpOtherMem, SendFlags, 5000, &NumRead);

//if lResult == 0 then failure or timeout, if GetLastError reports 0, then it is a timeout
//if successful NumRead contains the number of characters, if NumRead == 0 then the name is empty

BOOL bResult = ReadProcessMemory(hProcess, OtherMem, CtlName, bufsize,
&NumRead);

//CtlName now contains the instance name of the control, or is empty if there is no name

//clean up
bResult = CloseHandle(hProcess);
bResult = VirtualFreeEx(hProcess,OtherMem,1024,MEM_RELEASE);

http://www.autoitscript.com/forum/index.php?showtopic=78561&view=findpost&p=567202

#663 Fixed AU3_PixelChecksum returns 0x80000000 if more than that Jon Hollinar
Description

While making a c++ program to automate something, I ran into this problem. The DLL returns 0x8000000 if the checksum is more than that. I've searched the bug tracker for this problem and noticed a previous report where you wrote that it works for you. I've tried the same au3 script as was added to that report, and it doesn't end up with a value more than 0x80000000 so it doesn't cause the problem. However, the slightly modified version I've attached DOES cause the problem, using both 3.2.13.9 AND 3.2.12.1... The problem is, it doesn't cause the problem every time because each checksum is different.

#677 Works For Me ControlGetHandle/ControlListView on .Net Listview crashes/not working with Vista64 Jon freakazoid
Description

Sample Application: http://www.ondotnet.com/dotnet/2002/10/28/examples/listview-example.zip from http://www.ondotnet.com/pub/a/dotnet/2002/10/28/listview.html?page=2

I had this problem also with other programs using listview and another user reporting the same.

Sample script:

msgbox (0, "", "started");
$captcha_window_handle = WinGetHandle("C:\temp\listview");
msgbox (0, "", "we got the windowhandle: "&$captcha_window_handle);
$captchahandle = ControlGetHandle ($captcha_window_handle,"","[CLASS:WindowsForms10.SysListView32.app.0.378734a; INSTANCE:1]");		
msgbox (0, "", "we got the controlhandle:" &$captchahandle);
$value = ControlListView($captcha_window_handle,"",$captchahandle,"GetText",0,0);		
msgbox (0, "", "controllistview value:"&$value);

The sample app uses the path you run it in as windowtitle, so the second line needs to be set to your local settings. The script runs fine and without any issues on WinXP32, but on Vista64 the ControlGetHandle fails to return any handle or if successful it crashes the target app when using ControlListView.

I've tried this with the last beta and current release version, same negative effect.

Note: See TracQuery for help on using queries.