Is there a way开发者_运维知识库 to obtain the name of the icons in the Windows Control Panel, and find out their coordinates?
One more question - if I have an application running and that contains buttons, is there a possible way to obtain the name of the button, as in string
?
http://msdn.microsoft.com/en-us/library/ee330741(v=VS.85).aspx lists the "canonical names" of each control panel item. For example, Microsoft.DateAndTime
for the one that sets your date and time. http://msdn.microsoft.com/en-us/library/cc144191(v=VS.85).aspx shows how to use WinExec (which you may or may not be able to use from Java, I don't know) to launch an item given it's canonical name, for example
WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL);
There is quite a lot of community content on that page, indicating that perhaps it's a bit trickier than the documentation suggests. I suspect that getting your code to work smoothly on XP, Vista, and 7 may be frustrating.
The Mail icon is missing from MS's list.
This source indicates that it's canonical name is "Mail".
Check out: http://msdn.microsoft.com/en-us/library/bb776778(v=VS.85).aspx
精彩评论