I can detect the mouse location by using XQueryPointer. Now I want to know the location of the directory that contains my mouse.
Is there any way to do this ?
Thank you!
Related
It was easy when the Windows' explorer was using a SysListView32 control for displaying its files list as opposed to the DirectUIHWND control in the subsequent versions of Windows after XP.
A simple task such as obtaining the 'hot item' which is that item (a filename) the mouse hovers above for some hundreds of milliseconds, where before I could use the macros
ListView_GetHotItem with ListView_GetItemText and be able to obtain the filename under the mouse cursor.
This simple task becomes almost impossible to do with the DirectUIHWND window unless I revert this control back to a
SysListView32 which I have seen being proposed as the only solution on the many sites I have searched, and even if used the change does not occur immediately but only after I navigate out of the folder first.
It has taken me almost 2 years trying to find a solution to this and until now I feel stumped.
Anyone any idea please ?
Basically I have subclassed the parent of the tooltip and intercepted the tooltip notifications and all I need is the filename and the full path of the item the mouse hoovers above it, the hot item.
https://learn.microsoft.com/en-us/archive/msdn-magazine/2000/march/windows-2000-ui-innovations-enhance-your-user-s-experience-with-new-infotip-and-icon-overlay-shell-extensions
IQueryInfo is required to provide the runtime text to the shell. IPersistFile is used by Explorer to let the extension know about the specific file currently under the mouse pointer.
I would like to simulate 3D mouse operation to rotate/pan/zoom elements in "Blender" (on OSX).
Is it possible?
Thanks a tone for your help!
Take a look at this:
Mouse Button Emulation
Under File -> User Preferences -> Input, tick 'Emulate 3 Button Mouse'. The link shows the default shortcuts for an Apple one button mouse.
did you get to solve your problem? We're trying to rotate an Object via Java in another 3D App (3DVia). Since we couldn't find an API, we want to simulate a Space-Mouse. We tried the Java Robot class, but you can only move the primary mouse cursor.
I have an app that can create secondary tiles on start screen based on user's choice.
The secondary tile opens up a document. there is one requirement that whenever the document is renamed, the tile associated with it (if exist), its navigation uri must also be updated so that secondary tile always points to same document.
But i am not able to do this. Only way I see is to delete and recreate the tile. which actually not useful (because it navigates to start screen). i just want to do it internally. However, ShellTile.Update method seems no useful to me.
Kindly help.
Any help will be highly appreciated.
Thanx in advance
Instead of using a navigation URL to direct the user to the document, use an unique ID that doesn't change when the document is renamed. That way, no matter what happens to the name of the document, the tile will point to where it should.
How can I place a Qt4 widget just above the system tray on windows.
Since exact coordinates may depend on resolution and even the size and placement of the task bar(top or bottom of the screen etc.)?
I think there is probably a method for getting the screen resolution, but is there any method for getting the size of the taskbar and placement?
No, there isn't.
You can get the screen size using QDesktopWidget - this will give you the number of screens, screen size etc. However, finding the location of the task bar, and then the system tray is platform specific.
Why do you want to do this? Are you trying to emulate a QSystemTrayIcon? Perhaps if you told us what you're trying to do we may be able to help you.
Answering my own question, but apparently with Qt 4.3 I can get the coordinates of the tray icon using QSystemTrayIcon.geometry() method. So I can place my window relatively. It would be even better if I could get the position of the task bar but I guess I can figure out something for it.
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qsystemtrayicon.html#geometry
I want to extend an existing application I made to make it set mixer volume by wheel-scrolling over it's notification area icon.
As far as I know, the notification area doesn't receive any WM_MOUSEWHEEL messages, but still I found an application that does exactly what I want to achieve (http://www.actualsolution.com/power_mixer).
Using WinspectorSpy I've noticed some strange messages the application's form receives: 0x000003d0 and 0x000003d1, but I found no references about them.
Does anyone have any idea on how I could achieve the desired functionality?
If you want to capture mouse/keyboard events outside of your application you will need Low-level Hooks.
A nice beginners article about installing a mouse hook in Delphi is How to Hook the Mouse to Catch Events Outside of your application on About.com written by Zarko Gajic.
The user which starts your application will need administrative rights to install a hook.
After you capture the message you should determine if it's above your icon in the notification bar (which can be difficult because there is no exact api to get your position on the bar) and than process the scroll event.
I explained about the mouse hooking, and mentioned it could be difficult to locate your exact icon. I did found the following article about how to locate a tray icon.
CTrayIconPosition - where is my tray icon? by Irek Zielinski. I think if you try to understand how it works you can turn it around and use it to check if your mouse is currently positioned above your icon.
But you should first check if the mouse is even in the tray area. I found some old code of mine (2005) which locates the correct region.
var
hwndTaskBar, hwndTrayWnd, hwndTrayToolBar : HWND;
rTrayToolBar : tRect;
begin
hwndTaskBar := FindWindowEx (0, 0, 'Shell_TrayWnd', nil);
hwndTrayWnd := FindWindowEx (hwndTaskBar , 0, 'TrayNotifyWnd',nil);
hwndTrayToolBar := FindWindowEx(hwndTrayWnd, 0, 'ToolbarWindow32',nil);
Windows.GetClientRect(hwndTrayToolBar, rTrayToolBar);
end
Using this piece of code and the knowledge from the mentioned article I think you could implement the functionality that you wanted.
Not sure if this will solve the problem but it might be worth a try as a starting point. You could create a top level transparent window that you then position over the top of the taskbar icon. That top level window will receive mouse notifications when the mouse is over it. You can then process them as required. How to find the screen location of the taskbar icon is something I do not know and so that might be an issue.
Id don't know if this will help you, but in Delphi the standard Message library states:
WM_MOUSEWHEEL = $020A;
It would also be helpful if you let as know which language you are using.
Just thought I'd point out that Power Mixer is capturing scroll wheel events on the whole taskbar, while the mouse middle click operates just on the sys tray icon.