floating address bar

Features wanted...
Post Reply
CompSystems
Posts: 256
Joined: 09 Nov 2012 14:35
Location: Colombia
Contact:

floating address bar

Post by CompSystems »

:idea:

One of the ways the applications work is to store files in different parts of the hard drive, I use xyplorer with tab technology to locate the different storage directories. Applications always ask us where to store, but very few remember the storage locations or they get misconfigured easily, so I have to constantly go to xyplorer to copy the path and paste it in the different applications.

The idea that I propose is a floating address bar, that is, always visible or on top of the other apps, to be able to copy and paste different routes very quickly.

Horst
Posts: 1085
Joined: 24 Jan 2021 12:27
Location: Germany

Re: floating address bar

Post by Horst »

There are applications like Listary, QAP or AHK scripts which insert the current path
from opened file managers.
They also work perfectly for XY.
An additional floating address bar would simply waste display space.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: floating address bar

Post by admin »

Whatever you take, try a smaller dose. ;)

CompSystems
Posts: 256
Joined: 09 Nov 2012 14:35
Location: Colombia
Contact:

Re: floating address bar

Post by CompSystems »

Horst wrote: 16 Mar 2023 15:19 There are applications like Listary, QAP or AHK scripts which insert the current path
testing those apps, but how do they interact with XYplorer? If they do not allow, for example, to open a certain folder, I only see that they open specific files
Horst wrote: 16 Mar 2023 15:19 An additional floating address bar would simply waste display space.
I don't think space is wasted because it's a simple horizontal line and we currently have large screens

Horst
Posts: 1085
Joined: 24 Jan 2021 12:27
Location: Germany

Re: floating address bar

Post by Horst »

CompSystems wrote: 16 Mar 2023 17:13
Horst wrote: 16 Mar 2023 15:19 There are applications like Listary, QAP or AHK scripts which insert the current path
testing those apps, but how do they interact with XYplorer? If they do not allow, for example, to open a certain folder, I only see that they open specific files
Totaly wrong.
They all feed the path of open folders of the file manager (XY and others) into Open/Save dialogs.
Searching for files or dirs is an additional function of Listary for example.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

Norn
Posts: 416
Joined: 24 Oct 2021 16:10

Re: floating address bar

Post by Norn »

I suggest you use AHK, example:

Code: Select all

#Requires AutoHotkey v2.0.2

; Get our own HWND (we have no visible window)
DetectHiddenWindows(true)
G_OwnHWND := WinExist("Ahk_PID " DllCall("GetCurrentProcessId"))
G_OwnHWND += 0

global dataReceived := ""
; Get messages back from XYplorer
OnMessage(0x4a, Receive_WM_COPYDATA)

allTabs := XYGetAllTab()
if(!allTabs)
{
   msgbox "XYplorer is not running!"
   exitApp
}



;==================================================================================================
; Gui
;==================================================================================================

; Create the MyGui window:
MyGui := Gui("+Resize", "Untitled")  ; Make the window resizable.

Edit1 := MyGui.Add("Edit", , StrSplit(allTabs, "|")[1])
Edit2 := MyGui.Add("Edit", "vMyEdit r5", StrSplit(allTabs, "|")[2])  ; r5 means 5 rows tall.

Btn := MyGui.Add("Button", "default xm", "OK")  ; xm puts it at the bottom left corner.
Btn.OnEvent("Click", ProcessUserInput)

; Apply events:
MyGui.OnEvent("Close", ProcessUserInput)
MyGui.OnEvent("Escape", ProcessUserInput)
MyGui.OnEvent("Size", Gui_Size)
Edit1.OnEvent("Focus", Ctrl_Focus)
Edit2.OnEvent("Focus", Ctrl_Focus)
MyGui.Opt("AlwaysOnTop")
MyGui.Show()

; Size and Positon
Edit2.GetPos(, , &w2, &h2)
if(w2 < 500)
   Edit2.Move(, , 800)

Edit1.GetPos(, , &w, &h)
    Edit1.Move(, , w2)

;Btn.GetPos(&Bx, &By)
Btn.Move(, h+h2+20, 80, 30)

;MyGui.GetPos(,, &Gw, &Gh)
MyGui.Move(, , w+w2+22, h+h2+100)


Gui_Size(thisGui, MinMax, Width, Height)
{
    if MinMax = -1  ; The window has been minimized. No action needed.
        return
    ; Otherwise, the window has been resized or maximized. Resize the Edit control to match.
    Edit1.Move(,, Width-23)
	Edit2.Move(,, Width-23, Height-80)
	Btn.Move(, Height-38)
}


; Refresh values
Ctrl_Focus(GuiCtrlObj, Info)
{
    allTabs := XYGetAllTab()
	Edit1.value := StrSplit(allTabs, "|")[1]
	Edit2.value := StrSplit(allTabs, "|")[2]
}


ProcessUserInput(*)
{
    Saved := MyGui.Submit()  ; Save the contents of named controls into an object.
    ;MsgBox("You entered:`n" Saved.MyEdit)
	exitApp
}






;==================================================================================================
; XYplorer Send and Get functions
;==================================================================================================

F1::
{
    allTabs := XYGetAllTab()
    path := XYGetPath()
    all  := XYGetAll()
    sel  := XYGetSelected()
    MsgBox path
    MsgBox all
    MsgBox sel
	MsgBox allTabs
return
}


XYGetAllTab()
{
    return XY_Get(true, true)
}


XYGetPath()
{
    return XY_Get()
}


XYGetAll()
{
   return XY_Get(true)
}


XYGetSelected()
{
   return XY_Get(, true)
}


XY_Get(bAll:=false, bSelection:=false)
{
    xyQueryScript := '::if (!' bAll ' && !' bSelection ') {$return = "<curpath>"`;} elseif (' bAll '&&' bSelection ') {$return = <curpath> . "|" . get("tabs", "<crlf>", "1") . "<crlf>" . get("tabs", "<crlf>", "2")`;} elseif (' bAll ') {$return = listpane(, , , "<crlf>")`;} elseif (' bSelection ') {$return = get("SelectedItemsPathNames", "<crlf>")`;} copydata ' G_OwnHWND ', "$return", 2`;'

    Send_WM_COPYDATA(xyQueryScript)

    return dataReceived
}


GetXYHWND() {
	static xyClass := 'ahk_class ThunderRT6FormDC'

	if hwnd := WinActive(xyClass)
		return hwnd
	else if WinExist(xyClass)
		return WinGetList(xyClass)[1]
}


Send_WM_COPYDATA(message) {
   xyHwnd := GetXYHWND()

   if !(xyHwnd)
       return

   size := StrLen(message)
   if !(StrLen(Chr(0xFFFF))) {
      data := Buffer(size * 2, 0)
      StrPut(message, &data, size, "UTF-16")
   } else {
      data := message
   }

   COPYDATA := Buffer(A_PtrSize * 3)
   NumPut("Ptr", 4194305, COPYDATA, 0)
   NumPut("UInt", size * 2, COPYDATA, A_PtrSize)
   NumPut("Ptr", StrPtr(data), COPYDATA, A_PtrSize * 2)

   return DllCall("User32.dll\SendMessageW", "Ptr", xyHwnd, "UInt", 74, "Ptr", 0, "Ptr", COPYDATA, "Ptr")
}


Receive_WM_COPYDATA(wParam, lParam, *) {
	global dataReceived := StrGet(
		NumGet(lParam + 2 * A_PtrSize, 'Ptr'), ; COPYDATASTRUCT.lpData, ptr to a str presumably
		NumGet(lParam + A_PtrSize, 'UInt') / 2 ; COPYDATASTRUCT.cbData, count bytes of lpData, /2 to get count chars in unicode str
	)
}
Modify the Gui according to your needs. ;)
Win10, Win11 @100% 2560x1440 22H2

Post Reply