Page 2 of 3

Re: WinSpy - Window Information Tool

Posted: 02 Dec 2017, 12:09
by BoBo
playthegammee wrote:This tool picks up elements in programs that other tools dont. Thank you!

In Python there is a tool that generates code https://www.youtube.com/watch?v=xaMFHOq_Hls

If you plan on expanding it one idea would be to let users generate the AHK code.

So for example, if I do a send message, or remove or add style maybe we can generate the code behind it speeding things up for development.
That's cool stuff bc :arrow: PyWinAuto is offering to automate things on Linux too :thumbup:

Re: WinSpy - Window Information Tool

Posted: 02 Dec 2017, 13:49
by Georgie Munteer
BoBo wrote:
playthegammee wrote:This tool picks up elements in programs that other tools dont. Thank you!

In Python there is a tool that generates code https://www.youtube.com/watch?v=xaMFHOq_Hls

If you plan on expanding it one idea would be to let users generate the AHK code.

So for example, if I do a send message, or remove or add style maybe we can generate the code behind it speeding things up for development.
That's cool stuff bc :arrow: PyWinAuto is offering to automate things on Linux too :thumbup:
had no clue they have it for linux

also see this, maybe the maker of this software can add

https://autohotkey.com/boards/viewtopic.php?f=5&t=40796

So I am using autogui and I checked out the Constantine tool. So many options, and the only way to visualize them is to see samples.

Is there a tool that shows samples of the different styles as you select them?

Re: WinSpy - Window Information Tool

Posted: 02 Dec 2017, 19:03
by Alguimist
Georgie Munteer wrote:Is there a tool that shows samples of the different styles as you select them?
Styles of windows/controls can be changed with WinSpy. There's also a tool from Microsoft called ControlSpy, but the download link seems to be unavailable. You should be able to use AutoGUI as well because the options menu for controls are restricted to the most commonly used, apart from a complete list of styles.

Re: WinSpy - Window Information Tool

Posted: 05 Dec 2017, 07:06
by Progprog
when you select the Commands button and then un-check Visible, what code do you use to make that window not visible?

Re: WinSpy - Window Information Tool

Posted: 05 Dec 2017, 12:05
by Alguimist
Progprog wrote:when you select the Commands button and then un-check Visible, what code do you use to make that window not visible?
This is the code in use to toggle the visibility:

Code: Select all

ShowWindow(g_hWnd, !IsWindowVisible(g_hWnd))
ShowWindow and IsWindowVisible are wrappers to Windows functions with the same name:

Code: Select all

ShowWindow(hWnd, nCmdShow := 1) {
    DllCall("ShowWindow", "Ptr", hWnd, "Int", nCmdShow)
}

IsWindowVisible(hWnd) {
    Return DllCall("IsWindowVisible", "Ptr", hWnd)
}

Re: WinSpy - Window Information Tool

Posted: 05 Dec 2017, 16:53
by Progprog
Alguimist wrote:
Progprog wrote:when you select the Commands button and then un-check Visible, what code do you use to make that window not visible?
This is the code in use to toggle the visibility:

Code: Select all

ShowWindow(g_hWnd, !IsWindowVisible(g_hWnd))
ShowWindow and IsWindowVisible are wrappers to Windows functions with the same name:

Code: Select all

ShowWindow(hWnd, nCmdShow := 1) {
    DllCall("ShowWindow", "Ptr", hWnd, "Int", nCmdShow)
}

IsWindowVisible(hWnd) {
    Return DllCall("IsWindowVisible", "Ptr", hWnd)
}
so say I have a window with a title of Trainer Schedule that I want to hide, how would I do that using your method, the regular winhide method does not work for me :`-( yet when I drag the cross hairs from your program over my program and unchecked visible it works great

Re: WinSpy - Window Information Tool

Posted: 05 Dec 2017, 18:00
by Alguimist
WinHide also works, just make sure that you can uniquely identify the window using a matching criteria. See WinTitle for examples (Title, ahk_class, ahk_exe).

Re: WinSpy - Window Information Tool

Posted: 21 Dec 2017, 22:26
by SOTE
WinSpy is an updated improvement in AutoHotkey code, but was looking for something more similar to Winspector, which gives the information on windows messages. It appears that this WinSpy simply allows you to test for a specific one, as oppose to finding out what they are when you don't know them and what parameters to use.

Re: WinSpy - Window Information Tool

Posted: 22 Dec 2017, 15:37
by Alguimist
It is a planned feature. The monitoring of messages with SetWindowsHookEx requires a DLL (error 1428: cannot set nonlocal hook without a module handle) that I have yet to produce.

Re: WinSpy - Window Information Tool

Posted: 22 Dec 2017, 16:56
by jeeswg
One possibility: AHK v1.1 + AutoHotkeyMini.dll + InjectAhkDll function:
[prototype window spy]
how to dll Inject - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 82#p166682
[a variant of InjectAhkDll which does not require _Struct.ahk]
how to dll Inject - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 80#p171580
[get x64 and x32 versions of AutoHotkeyMini.dll]
GitHub - HotKeyIt/ahkdll-v1-release: AutoHotkey_H v1 release
https://github.com/HotKeyIt/ahkdll-v1-release

Re: WinSpy - Window Information Tool

Posted: 22 Dec 2017, 21:45
by Alguimist
@jeeswg: I couldn't get your code to work.

I have been examining the source code of Window Detective. It uses a small DLL called WD_Hook.dll to monitor messages. Here is an excerpt of Hook.cpp:

Code: Select all

/*--------------------------------------------------------------------------+
| Installs the hook procedure into the hook chain.                          |
+--------------------------------------------------------------------------*/
DWORD InstallHook() {
    // Hook for calling window procedure
    callWndHook = SetWindowsHookEx(WH_CALLWNDPROC, CallWndProc, dllInstance, 0);
    if (!callWndHook) return GetLastError();

    // Hook for returning from window procedure call
    callWndRetHook = SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, dllInstance, 0);
    if (!callWndRetHook) return GetLastError();

    // Hook for getting a message off the queue
    getMsgHook = SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, dllInstance, 0);
    if (!getMsgHook) return GetLastError();
    
    return S_OK;
}

Re: WinSpy - Window Information Tool

Posted: 23 Dec 2017, 02:01
by SOTE
Alguimist wrote:It is a planned feature. The monitoring of messages with SetWindowsHookEx requires a DLL (error 1428: cannot set nonlocal hook without a module handle) that I have yet to produce.
Glad to see there will be updates. Would humbly suggest taking a look at API Monitor ( http://www.rohitab.com/downloads ). It can decode WM_Messages to hex and decimal to hex, for a PostMessage and SendMessage ready format. It might give some ideas. A pure AutoHotkey solution would be preferable.

Re: WinSpy - Window Information Tool

Posted: 08 Sep 2018, 05:59
by Alguimist
Version 1.0.3:
• Much more information about Scintilla controls is displayed in the Extra tab.
• Minor bug fixes.

:arrow: See the initial post for the download link and a detailed description of all features.

Re: WinSpy - Window Information Tool

Posted: 10 Sep 2018, 06:34
by DRocks
thanks for the update!

Re: WinSpy - Window Information Tool

Posted: 26 Oct 2018, 05:29
by DRocks
Hello Alguimist, for the first time Windows10 antimalware started detecting a trojan when executing WinSpy? I've been using it for the last year and now they say its not safe... any clue what could make it say that?

Re: WinSpy - Window Information Tool

Posted: 26 Oct 2018, 16:52
by robodesign
That's what windows says about compiled binaries with AHK for the past few months...... I submitted a few binaries to Microsoft and marked as not malware, but still insists on it ....

Re: WinSpy - Window Information Tool

Posted: 29 Oct 2018, 04:17
by Bensley
I think to completely replace all other similar tools you should add an option that uses active window as a default window to extract information from and real time mouse position (screen and Awindow coordinates).
It would be practical for cases when you need something basic, which in my case is 90+% of the time :D
Just a thought.

Re: WinSpy - Window Information Tool

Posted: 30 Jan 2019, 22:33
by Alguimist
DRocks wrote:
26 Oct 2018, 05:29
Hello Alguimist, for the first time Windows10 antimalware started detecting a trojan when executing WinSpy? I've been using it for the last year and now they say its not safe... any clue what could make it say that?
If this occurs, run WinSpy from the script, which is in the same folder of the executables.
Bensley wrote:
29 Oct 2018, 04:17
I think to completely replace all other similar tools you should add an option that uses active window as a default window to extract information from and real time mouse position (screen and Awindow coordinates).
Mouse position (relative to screen, window, client) is displayed in WinSpy when you move the drag tool, except in Compact Mode. As for the way by which a window/control is selected, I am convinced that the drag-and-release approach is more convenient: it doesn't require the target window to be active and the press of a key to freeze that information in the display.

Re: WinSpy - Window Information Tool

Posted: 30 Jan 2019, 23:23
by SOTE
Alguimist wrote:
30 Jan 2019, 22:33
DRocks wrote:
26 Oct 2018, 05:29
Hello Alguimist, for the first time Windows10 antimalware started detecting a trojan when executing WinSpy? I've been using it for the last year and now they say its not safe... any clue what could make it say that?
If this occurs, run WinSpy from the script, which is in the same folder of the executables.
Bensley wrote:
29 Oct 2018, 04:17
I think to completely replace all other similar tools you should add an option that uses active window as a default window to extract information from and real time mouse position (screen and Awindow coordinates).
Mouse position (relative to screen, window, client) is displayed in WinSpy when you move the drag tool, except in Compact Mode. As for the way by which a window/control is selected, I am convinced that the drag-and-release approach is more convenient: it doesn't require the target window to be active and the press of a key to freeze that information in the display.
I think it might be possible that non-experts or laymen see the word "spy" in the name of your software and false flag it. Then lazy anti-virus or malware companies put your software on their list. Various other bigger companies copy those lists, and tag the software too. A very bad circle jerk happens, where software that should not be on malware lists, get put on. And if Google gets a hold of your software name on such a list, they exponentially make the problem worse, by putting your software and/or website on their blacklist (which they are very reluctant to take off).

The only way to counter this is to report this false flagging and false positives to the bigger companies, Microsoft being one of them. When reported to Microsoft as a false positive, their experts see that and take your software off their lists. I've actually seen various version of Windows Defender, tag the software as malware, and then subsequently versions not do so. Clearly, there is some flawed mechanism at work, where the program repeatedly gets put on and then taken off their lists. I can say that reporting false positives to Microsoft does work, for specific versions of software released. If an updated version of software is made, people might need to resubmit their software again to Microsoft for analysis.

To report a false positive to Microsoft, everyone can help by doing this-

https://www.microsoft.com/en-us/wdsi/filesubmission
(Report False Positives To Microsoft Or Submit Software For Analysis)

If a "Home Customer" select that.
Select "Continue".
You don't have to sign in, so can press "Skip"
At the Submit A File screen

Code: Select all

Do you believe this file contains malware?

No — this file has been incorrectly detected

And select the file you wish to submit

Re: WinSpy - Window Information Tool

Posted: 31 Jan 2019, 14:48
by ruespe
Alguimist wrote:
30 Jan 2019, 22:33
Mouse position (relative to screen, window, client) is displayed in WinSpy when you move the drag tool, except in Compact Mode. As for the way by which a window/control is selected, I am convinced that the drag-and-release approach is more convenient: it doesn't require the target window to be active and the press of a key to freeze that information in the display.
Great little tool, thanks for sharing. Unfortunately in my case WinSpy shows the same cursor-position in Windows-mode as well as in Client-mode (shouldn't it be "Control-mode"?). In both cases the mouse position related to the control is shown.

And why not show all three cursor positions side-by-side instead of heaving to switch every time?

ruespe