LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect what file or folder was selected in Windows File Dialog

Hmm, I get the same -603. I'm using WinXP. Is that "l" between "OpenSavePid" and "MRU\" correct?

0 Kudos
Message 11 of 20
(444 Views)

OK. I tried it on win7, so you will need to navigate to that key in registry and figure out if it is different in winxp.

Mine looks like this:

 

reg.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to our Test Automation user group: UK Test Automation Group
0 Kudos
Message 12 of 20
(443 Views)

One step closer!

 

This is it for XP:

"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\"

 

Error moved over to after "Read Registry Value Simple.vi"

Something wrong with "MRUListEx"?

0 Kudos
Message 13 of 20
(435 Views)

Can you see that subkey in your registry? As I said before, that bit is undocumented, I came across it in some random post when I had to do something similar. So it may be completely different in xp!


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to our Test Automation user group: UK Test Automation Group
0 Kudos
Message 14 of 20
(433 Views)

Yes, in each extension folder there is a subkey "MRUList". I changed the the read argument to that. The -603 Error moved to after the next and final  "Read Registry Value Simple.vi" The input is "102" if looking for *. It changes to "106" for "bmp"

0 Kudos
Message 15 of 20
(424 Views)

That's not right. You need to see how that value correlates to a value in the list. Can you post a screenshot of your registry like mine above?

If you look at my screenshot, my first byte is 0x0a which corresponds to 10 in the list, which is the list index of the last file opened in that extension subfolder.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to our Test Automation user group: UK Test Automation Group
0 Kudos
Message 16 of 20
(420 Views)

Looks like XP uses String, not binary?

0 Kudos
Message 17 of 20
(412 Views)

That looks easy. So instead passing number string, just pass the first letter. Use string subset function or something similar (so in the sscreenshot it looks like f is your list index ) and you will have the file name from the next read function. You don't need to call shell32dll.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to our Test Automation user group: UK Test Automation Group
Message 18 of 20
(408 Views)

Getting closer. Using * shows the path to the screen shot.jpg that I just sent you! If I change the search to bmp, it shows the path to the last bmp. But if I go to Windows explorer, load a Excel .xlsx, save that file with a different name, then run the Registry thing with *, it still shows the screen shot.jpg. If I then change the search to xlsx, it shows a path an Excel file opened weeks ago, not the one I just opened and resaved. Well, I'll look at it some more tomorrow. Thanks aCe.

0 Kudos
Message 19 of 20
(396 Views)

Final thoughts for this in WIn XP. After getting the Registry MRU to read, I tested it and found that not all applications update the lists immediately, if at all. MS Paint, and MS Notepad do, but only from within the application using the File>Open pulldown. MS Word, and MS Excel don't update the lists at all. And unfortunately, my target application doesn't either. This approach does work, but in XP, not that well. Kudos for aCe anyway! Very clever.

 

0 Kudos
Message 20 of 20
(376 Views)