Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help to activate and close the correct folder.
If I have C:\Windows\System and C:\Windows\SystemApps open,
and I want to activate C:\Windows\System using a string, the code will activate
C:\Windows\SystemApps instead. The string is populated by an input.

So the input is "C:\Windows\System" (No Quotes) and both windows are inactive, When I use the code:
Macro OC
Copy      Help
str s1
int w1=act(win(sFolder "CabinetWClass"))

It always activates C:\Windows\SystemApps instead.
This must be a flaw of windows, but is there a work around?
Need to activate and close the correct folder.
Is there a way to figure out the difference between the two folders for certainty??

Much thanks in advance.
Option 1 - with win use flag 1. Then sFolder must be full name or contain wildcard characters *?.
Option 2 - find all matching windows and let the user to choose from a menu or list dialog.

int w1=act(win(sFolder "CabinetWClass" "" 1|2))
That worked perfectly!
Thank you so very much Gintaras, I was going crazy...
Gintaras, one quick question.
Is there a way I can modify the title bar display for dialogs?

BrowseForFolder - before calling it, start new thread that waits for the dialog and changes its title. Example:

Macro Macro2614
Copy      Help
mac "sub.ChangeTitle" "" "TEST"

#sub ChangeTitle
function str's
int w=wait(5 WA win("Browse for Folder" "#32770"))

SelectFileDialogWithTreeview - you can edit the function:

Add new parameter [$title]:
Copy      Help
function! str&sSelectedFile [$initFolder] [hwndOwner] [$title]

And change the str dd=...END DIALOG code:
Copy      Help
if(empty(title)) title="Select File"
str st=title; st.escape(1)
str dd=
;1 "" 0x90C80AC8 0x0 0 0 224 280 "{st}"
;3 SysTreeView32 0x54030823 0x0 0 0 224 256 ""
;1 Button 0x54030001 0x4 116 260 48 14 "OK"
;2 Button 0x54030000 0x4 168 260 48 14 "Cancel"
;DIALOG EDITOR: "" 0x2040201 "*" "" "" ""
Again thank you!!

Forum Jump:

Users browsing this thread: 1 Guest(s)