New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Announce the version of the application with focus #1625
Comments
Attachment globalCommands.diff added by PZajda on 2011-06-29 18:25 |
Comment 1 by mdcurran on 2011-06-29 23:38 |
Comment 3 by PZajda on 2011-07-01 14:22 |
Comment 4 by briang1 on 2011-07-01 17:14 |
Attachment DevInfoWithVersionInfo.patch added by PZajda on 2011-07-01 20:06 |
Comment 5 by PZajda on 2011-07-01 20:10 |
Comment 6 by jteh on 2013-02-13 08:41 |
Comment 7 by PZajda on 2013-09-27 20:34 OK... I am trying to do that using ctypes but I don't find anyway to get a real path, I have only paths like \Device\HarddiskVolume1\folder\file.exe and I have to add another dependency to convert this type of paths to a regular one. I'm still looking for a way to do that but it seems to be a little hard :) |
Comment 8 by PZajda on 2013-09-29 12:35 |
Comment 9 by PZajda on 2013-09-30 20:06 I made some changes to appModuleHandler.py:
Next I'll add these attributes to the objects themselves and to the developers info to display these when pressing NVDA+F1. |
Comment 10 by jteh (in reply to comment 9) on 2013-09-30 21:38
Add-ons have exactly the same access.
There's no need to add these to the objects, since they apply to the application as a whole, so just make devInfo retrieve them from the app module. Thanks! |
Comment 11 by PZajda (in reply to comment 10) on 2013-10-01 09:11
OK... After a better look I understand my error.
OK, do you think it is good to let it to appModuleHandler or it is better to put it specifically in NVDAObject where we get developers info and modify the handle in oleacc? I though about appModuleHandler because product name and version are not specific to the object, but concern the application itself. Edit: if it is not a problem in appModule, it is better for me as it seems there is something else I don't understand with the object's processHandle which still denies me the access. |
Comment 12 by jteh (in reply to comment 11) on 2013-10-01 09:58
It does make more sense in appModuleHandler.AppModule, but that means you can't use the NVDAObject's processHandle. Hmm. The problem is that requesting more rights for AppModule.processHandle might break apps running as admin with UAC enabled.
If you're running Windows Vista or later, I just checked and found out that the Windows GetProcessHandleFromHwnd function doesn't provide PROCESS_QUERY_INFORMATION. That's rather annoying and means you can't use it anyway. For now, keep up the work in AppModule. We can always open a new process handle using the process ID (AppModule.processID) if necessary. |
Comment 13 by PZajda on 2013-10-01 12:45
I preferred to put the appModule prefix to avoid confusion. It is available on Bitbucket. |
Comment 14 by jteh on 2013-10-01 23:22
If you don't understand this (it's fairly complex), one of us can make this change. Thanks for your work. |
Comment 15 by PZajda on 2013-10-02 01:06 A little complex, but very instructive. Thanks! |
Comment 16 by PZajda on 2013-10-02 13:12 I tested it on Windows 7 64 bits and I noticed something strange: if I press NVDA+F1 in Dropbox, I have appModule.productName/Version with the right values. |
Comment 17 by PZajda on 2013-10-02 14:11 In fact, it seems we should use different function for about each version of Windows. An user on MSDN suggests to use WMI to be sure of the result, which is for me the same thing as if I would use a plane to visit my neighbor... For more informations: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683217%28v=vs.85%29.aspx |
Comment 18 by PZajda on 2013-10-07 10:54 About the program name I'm back on it today, I'll try to avoid using WMI. :) Edit: |
Comment 19 by PZajda on 2013-10-16 17:30 Now it is OK for Windows Vista and higher, I use QueryFullProcessImageName if the version is greater than 5, if I don't make a mistake it is Vista or higher. I tested on Windows 7 64 bits, with both 32 and 64 bits apps and it seems to work now. There is still a bad thing: it won't work on Windows Xp 64 bits, still this problem with paths format when using GetProcessImageFileName. To summarize: it works on Windows XP 32 bits, Vista and 7 32/64 bits, it should work on Windows 8 but I cannot test by myself. To remind:
Patrick |
Comment 20 by jteh on 2013-10-16 22:19 Code review: To make the code easier to read (less indentation, etc.), you can handle error conditions inside an if block but leave the rest of the code outside, since errors are the exceptional condition. For example:
You accidentally create the l variable twice:
When fetching the codepage, you only want the first one, so it's more efficient to just grab the first 4 bytes. You don't need to use array.tolist(); you can just pass it to the tuple constructor. Finally, since you're always using it as a string, you need only do that once. So:
Btw, Python syntax allows you to continue the same string on a subsequent line without concatenating two strings together, which is more efficient. So, you can do:
instead of:
Even so, I'd probably rewrite the above call as:
I'd probably use RuntimeError instead of Exception. nit: "No version informations." should be "No version information" Thanks again! |
Comment 21 by PZajda on 2013-10-17 16:12 |
Comment 24 by jteh on 2013-10-18 07:51 |
Comment 25 by PZajda (in reply to comment 24) on 2013-10-24 12:55 Replying to jteh:
After another read of MSDN pages about GetModuleFileNameEx and QueryFullProcessImageName, there may be something we can do about it: if I understood the problem correctly, the problem is the PROCESS_VM_READ access right, which is only useful for GetModuleFileName, which is only used for Windows earlier than Vista. The solution can be to give PROCESS_VM_READ access right to processHandle according to the Windows version. I made a new commit (rev 9248f4e) where I open a process handle according to the Windows version. I quickly tested on Windows Xp 32-bits and Windows 7 64 bits and it seems to work. |
Comment 26 by mdcurran on 2013-11-14 06:56 |
Comment 27 by PZajda (in reply to comment 26) on 2013-11-14 09:52
OK, I've just done and committed it. |
Comment 28 by Michael Curran <mick@... on 2013-11-15 03:44
Changes:
|
Comment 29 by mdcurran on 2013-11-15 03:46 |
Comment 30 by Michael Curran <mick@... on 2013-12-02 00:13
Changes:
|
Comment 31 by mdcurran on 2013-12-02 00:14 |
Comment 32 by Agent Golder on 2014-08-06 09:30 |
Comment 34 by bdorer on 2014-08-06 20:38 |
Comment 35 by Agent Golder on 2014-08-06 21:59 |
Reported by PZajda on 2011-06-29 18:23
It could be good if there were a globalCommand to allow NVDA to announce the product name and version of the application which has the focus.
Attached diff file allows that on source/globalCommands.py with the gesture NVDA+Shift+V.
The text was updated successfully, but these errors were encountered: