Hello all, I was wondering, Is it possible to hook into the active window (eg. notepad.exe) and get the menu strip from that window or application to copy it into a windows form in my application. Kind regards, AviiNL
No, It's a bit more complicated then that. For example I run notepad, and have it on the foreground, i want the menu of notepad cloned into my application but remaining the functionality with the notepad process. Now, I think the functionality will be possible using automation.. but i have no way to copy or clone the menu from an running process into my form.
If you do it, the imported menu won't will work on your application because the notepad.exe isn't a managed process. But it looks to work on the same notepad.
I Managed to get the text of the menu from any application in my project using user32 api calls now to figure out how to send the commands back (eg, hit file -> new in my program, and execute it in notepad) Thanks for thinking with me, Appriciated it
As Notepad is just a multiline TextBox you could easily write your own version in c++ or Managed Code and control it with whatever mechanism you choose.
I fixed it, and it is done, using Automation.. the notepad refrenced is just an example, it needs to work with.... everything that is running. What I did is to give my windows box an osx look and it turned out pretty nicely =]