Jump to content
Tuts 4 You

How to keep overlapping app windows in front on left mouse down and move?


LCF-AT

Recommended Posts

Hi guys,

I'm trying to find out how to make this (title question) possible. Normally I'm using Windows Explorer as file manager and the WE does handle the drag & drop function so that all other app windows which are set in from on the WE area keep in front when you do press the left mouse down on any selected file/s so that you can move that file in any other app window if you want. Just a normal drag & drop from WE into any other app Window like Notepad for example. I would like to know how to code this. So what I have to do or possibly hook to prevent setting the focus on my own app when I press left mouse etc you know.

Since a while I'm using another file manager called XYplorer what didn't had such a drag & drop function till I told the developer to implement such a function like the normal WE has. After long talking with them they did add that D&D function a while ago but unfortunately it's not working correctly as it should what I told them too after the first release and now after few months it's still not working. I made two small videos where you can see the problem about that failing drag & drop function so just have a look...

Drag_Drop_Problem.gif.418a182b9e59039c819267d5437e8b25.gif

....and...

Drag_Drop_Problem2.gif.6a1916914226014de9fa33e8b6e79498.gif

...so you can see the problems right. It's just working a few time (first video) and then the other app window pops into background because XYplorer gets the focus = problem. In the second video the problem is much more to see. All in all the drag / drop function like it works at the moment (as you can see in videos above) is not good and pretty annoying when you try to work on that way with the XYplorer.

Now I would like to know how to implement such a drag / drop function (just need to know what to do to keep those other app windows in front when you select a file etc. Just wanna ask you guys to get an example for that to try it by myself and in case of success I would tell the devs about that to let fix that problem. Maybe anyone of you guys know this already or has some ideas how to manage that.

greetz

Link to comment

I wish I could help LCF , but here is what I know , there is an option in windows explorer for example when you open mutiple folders , try to grab the top window and move the mouse down twice you'll find all other windows have been minimized , when you grap the window and move the mouse up twice the windows will appear again .... that's all I know maybe you can laverage this function somehow to help you in the hooking process.

 

https://i.imgur.com/DQ9DqRS.mp4

Regards,

Edited by NEW-RE
  • Like 1
Link to comment

Hey @maluc,

so the problem is this. When I set a break on WM_LBUTTONDOWN message and press on my app window then it was bring in front already before it does trigger WM_LBUTTONDOWN message. Otherwise I have to check the listview when I click & select any single item and I was trying to break at WM_NOTIFY & NM_CLICK but also in this case the main app window with the LV I have clicked is set in front before this message is reached. Somehow it must be handled before and I think you must hook anything etc. Otherwise I can catch at WM_NOTIFY / LISTVIEW handle when I hover with mouse over the LV I can trigger NM_CUSTOMDRAW and some other unknown values like -121 & -150. So the problem is that I need to handle the operation first when the left mouse button is pressed down. Hmm!

So there is a great tool called "Everything" what also shows a Listview and this works same as the WE. When you have overlapped some windows on Everything and you press left mouse down on any file in Everything then all other app windows are still in front and just if you release the left mouse then Everything brings itself in front or otherwise if you just move the mouse on left mouse button down (drag start) and release it then other app windows keep still in front. So this works same like the WE = what I want. But still don't know where to start to prevent this auto bring in front of the own app itself you know. Do you have any more ideas?

greetz

Link to comment
Teddy Rogers

Looking at the screenshots, XYplorer may be remembering z-order of the windows and returning to the same position on left click/ drag start or similar.

It does not appear to be the correct process for drag drop behavior if that is being done...

Ted.

  • Like 1
Link to comment

Hey @Teddy Rogers,

so I try to find out how to keep my own app window in the back when I left click on any item etc. My app itself does just force itself / focus before reaching any button down or other message. Just get my own app in front (other in back) and then I to bring other apps in front etc. Somehow that' bad. Must be getting better anyhow like WE / Everything does handle but how are they handle it is the question? Do you know that or do you know any example etc?

The Windows Explorer does it so: When you select any item from the listview and you keep the mouse down (left / middle / right) and release it then all other app windows you have set in font / overlapping on WE going into back = WE does focus itself in front action. When you do the same again without to release the pressed down mouse button and you start to drag and release now the mouse then app other app windows are still in front = still overlapping the WE window if they was set before so = very good. So I want to know how to manage / code this.

greetz

Link to comment
Teddy Rogers
On 6/29/2023 at 2:04 AM, LCF-AT said:

Do you know that or do you know any example etc?

Not sure of the best way to resolve this, never had to maintain (multiple) overlapping windows in drag drop situations. Thoughts would be to prevent the drag element from notifying its parent window it has focus on mouse button down and before drag start...

Ted.

  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...