Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help to activate and close the correct folder.
#1
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
Code:
Select All      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.
#2
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))
#3
That worked perfectly!
Thank you so very much Gintaras, I was going crazy...
#4
Gintaras, one quick question.
Is there a way I can modify the title bar display for dialogs?

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

Macro Macro2614
Code:
Select All      Help
mac "sub.ChangeTitle" "" "TEST"
BrowseForFolder(_s)


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

SelectFileDialogWithTreeview - you can edit the function:

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

And change the str dd=...END DIALOG code:
Code:
Select All      Help
if(empty(title)) title="Select File"
str st=title; st.escape(1)
str dd=
F
;BEGIN DIALOG
;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"
;END DIALOG
;DIALOG EDITOR: "" 0x2040201 "*" "" "" ""
#6
Ah.
Again thank you!!


Forum Jump:


Users browsing this thread: 1 Guest(s)