Zohar Posted December 26, 2015 Share Posted December 26, 2015 (edited) HiUp until now, I have used Spy++, and Resource Hacker, in order to know what is the WindowsMessage + wParam that is sent after performing some GUI operation,like clicking a MenuItem/ToolbarButton/etc. Are there other ways in addition to these 2 to get the message sent?Specifically, I am having a problem in catching the WindowsMessages being sent after clicking MenuItems in the Console Window (cmd.exe).I am using Windows XP.Thank you Edited December 26, 2015 by Zohar Link to comment Share on other sites More sharing options...
Zohar Posted December 27, 2015 Author Share Posted December 27, 2015 (edited) I should add that If I try to Spy on the cmd.exe window,I get this message: That's why I can't use Spy++, and looking for another option to get the Message and wParam that goes with it for each MenuItem.. Edited December 27, 2015 by Zohar Link to comment Share on other sites More sharing options...
Gianni Posted December 27, 2015 Share Posted December 27, 2015 have a look here: http://windowdetective.sourceforge.net/ Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Zohar Posted December 27, 2015 Author Share Posted December 27, 2015 Thank you Chimp.I installed it now, and it does not catch any WindowsMessage from the cmd.exe window..(probably the same problem that Spy++ has, just this program did not display a message about it) Link to comment Share on other sites More sharing options...
Gianni Posted December 27, 2015 Share Posted December 27, 2015 try like this:run the Window Detective programrun the cmd.exedrag the "Pick window" icon from the Window Detective to the cmd window. Doing so the "ConsoleWindowClass" will be highlighted in the process list on the Window Detective program.Now right click on the highlighted ConsoleWindowClass item and choose the "Messages..." item from the contestual menu. Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Zohar Posted December 28, 2015 Author Share Posted December 28, 2015 Thank you Chimp..I followed your steps now, and it's quite like I did before, and the result is the same the messages window remains empty even If I open the Window Menu, and click some items there, like Paste, or any other MenuItem.Did it catch messages successfully on your computer?(maybe it changes between versions of windows? I use Windows XP SP3) Link to comment Share on other sites More sharing options...
Gianni Posted December 28, 2015 Share Posted December 28, 2015 on a cmd.exe run on Win7 x 32 it worked, all messages about ConsoleWindowClass are shown while you use the cmd windows...... on a cmd.exe run on Win7 x 64 it doesn't works (messages window remains empty).I think that on Windows XP (32-bit) should work... (?) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Zohar Posted December 28, 2015 Author Share Posted December 28, 2015 I use Windows XP 32bit, and unfortunately it doesn't..But it's interesting, it might mean that one can copy the WindowsMessage + wParams from another version of windows..(and hopefully it will be identical)Definitely worth a check.. Link to comment Share on other sites More sharing options...
JohnOne Posted December 28, 2015 Share Posted December 28, 2015 probably, the cmd prompt is admin and the spy++ is not. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
junkew Posted December 29, 2015 Share Posted December 29, 2015 http://www.nektra.comSpystudio and other things can deep dive into your system. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Zohar Posted December 29, 2015 Author Share Posted December 29, 2015 probably, the cmd prompt is admin and the spy++ is not.I am using Windows XP, and my user is an administrator user.. http://www.nektra.comSpystudio and other things can deep dive into your system. Thank you,I downloaded it and ran it now,I hooked to cmd.exe's process, but I can't find anything regarding WindowsMessages there.. Link to comment Share on other sites More sharing options...
JohnOne Posted December 29, 2015 Share Posted December 29, 2015 I tried and get same result, apparently it is by design, something about csrss owning the console window.There are probably way around it, if you write your own spy app and do a bit of dll injection and other such voodoo.Too uninteresting for myself to care about looking into.Happy hunting. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
junkew Posted December 29, 2015 Share Posted December 29, 2015 Is it not just a windows console?https://msdn.microsoft.com/en-us/library/windows/desktop/ms682010(v=vs.85).aspx FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
JohnOne Posted December 29, 2015 Share Posted December 29, 2015 A command prompt is, yes. But interacting with it and intercepting messages to and from it are quite different. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
junkew Posted December 29, 2015 Share Posted December 29, 2015 I remember something on #32768 popup classes and spying on those but googled this maybe it helpshttps://autohotkey.com/board/topic/90307-hotkeyp-spy-utility-for-detecting-wm-command-messages/And I assume you have the same problem on the menus of calculatorWith simplespy in the IUIAutomation thread in examples I can spy on your menuitems with no problem. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted December 29, 2015 Share Posted December 29, 2015 and searching on #32768 revealed these answers FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Zohar Posted December 29, 2015 Author Share Posted December 29, 2015 (edited) on a cmd.exe run on Win7 x 32 it worked, all messages about ConsoleWindowClass are shown while you use the cmd windows...... on a cmd.exe run on Win7 x 64 it doesn't works (messages window remains empty).I should get a Windows 7 32bit VM, to get the messages out of it, and hopefully it's the same wParams on Windows XP too.Microsoft had VMs of various versions on Windows, on their website (for testing IE on diffefent versions of windows)I will check if it's still available, and if yes will try with it..BTW,I remember it was once said that Microsft released a part of the code of Windows..Maybe this part contains cmd.exe and it's window too?(I don't believe the window and Menu are contained in the cmd.exe file, it's probably in another file that acts as a wrapper for it... the quetion is which file is it?) Edited December 29, 2015 by Zohar Link to comment Share on other sites More sharing options...
junkew Posted December 30, 2015 Share Posted December 30, 2015 (edited) maybe this is part of the cause as messages spying is done with setwindowhookexIf you want to inject code into system services (lsass.exe, services.exe, winlogon.exe, and so on) or into csrss.exe, set the privileges of your process to "SeDebugPrivilege" (AdjustTokenPrivileges) before opening a handle to the remote process (OpenProcess). most likely a cmd.exe has a high privilege. Not sure how you could set the exe that is spying to have SeDebugPrivilege on cmd.exe Edited December 30, 2015 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now