News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Windows Explorer-style "browse for file" window

Started by raleeper, June 25, 2011, 08:49:58 PM

Previous topic - Next topic

dedndave

thanks, Jochen

funny you should say that about details, youngest on top
i have that exact setting as my default mode in explorer   :P
it took a little getting used to - and sometimes, i have to change it to alpha-name, but i like it so far

jj2007

Quote from: dedndave on February 15, 2012, 09:36:48 PM
funny you should say that about details, youngest on top
i have that exact setting as my default mode in explorer   :P

Standard settings for developers who create and save a new version once a day ;-)

dedndave

well i sent a message...
        INVOKE  SendMessage,hOfnLv,LVM_SETVIEW,LV_VIEW_DETAILS,0
but, i can't figure out how to force it to update
if i right-click in the listview, it refreshes in detail mode, so i know the message is getting received   :P
i was playing with LVM_UPDATE and LVM_REDRAWITEMS, but i am not sure what to use for wParam and lParam

dedndave

well - this is kinda hokee, but it does work   :P

        INVOKE  SendMessage,hOfnLv,LVM_SETVIEW,LV_VIEW_DETAILS,0
        INVOKE  PostMessage,hOfnLv,WM_RBUTTONDOWN,MK_RBUTTON,0
        INVOKE  PostMessage,hOfnLv,WM_RBUTTONUP,0,0
        INVOKE  PostMessage,hOfnLv,WM_LBUTTONDOWN,MK_LBUTTON,0
        INVOKE  PostMessage,hOfnLv,WM_LBUTTONUP,0,0


there must be a better way

jj2007

You tried sending this to the list view parent?
   ODM_VIEW_DETAIL   EQU 0702Ch
   invoke SendMessage, hLvP, WM_COMMAND, ODM_VIEW_DETAIL, 0

dedndave

no luck, there - i must be doing something wrong
i don't find much in the way of documentation for ODM_VIEW_DETAIL   :(

in fact, Paul DiLascia's article that i mentioned before, is the only place i see it - lol

hang on - i sent the message to the dialog
it needs to go to the SHELLDLL_DefView window

dedndave

that works - thanks, JJ   :U

let me do some cleanup, then i'll post

dedndave

ok - cleaned up version

i included both - one with list view and one with detail view, for comparison

again, we need someone to test this with windows 7 aero glass theme
the Open File dialog should open with the first file in the list under the cursor
much appreciated   :U

jj2007

Quote from: dedndave on February 16, 2012, 02:39:24 AM
that works - thanks, JJ   :U

That's what I use in RichMasm's WM_NOTIFY/CDN_FOLDERCHANGE handler...

You can comment out
;        INVOKE  SendMessage,hOfnLv,LVM_SETVIEW,LV_VIEW_DETAILS,0

dedndave

that sets the style for the listview control
i take it the WM_COMMAND message takes care of that, then ?

raleeper

Some final thoughts (now that I have this working pretty much as I want):

1. I probably couldn't have done it without the helpful posts by dedndave and others.

2. My original objective was to move the dialog window to (a function of) the current position of the mouse cursor.  I soon realized that I didn't care where the mouse cursor was; what I wanted was to move both box and mouse to a place on the screen where it would not cover up anything, or if that were not possible, at least nothing important.  (My method of finding an appropriate location is peculiar to to my large program and has no general application).

3. Later I'll work on 1) changing the size of the file list (up to a limit, it should be just large enough to show all the items in the folder without scrolling), 2) changing the initial keyboard focus from the text entry box to the file list (so that a file can be selected without using the mouse), and 3) adding a places bar.  Sources to which I was led by the mentioned helpful posts contain clues for doing this, but for now I am satisfied.

Thank you very much.
Robert

hfheatherfox07

Quote from: ragdog on February 07, 2012, 06:37:11 PM
Here is a nice example

I think it was from Gunner

Hi I have seen this thread ...and I tried this and I get 2 errors
Line 172 CDN_SELCHANGE
Line 185 CDN_FILEOK

I tried fixing this with any value but the Icons will not display ? why?


I tried
CDN_SELCHANGE  EQU "what ever #"
CDN_FILEOK EQU "what ever #"

LOL I actually had a real # value there

I found this thread :
http://www.masm32.com/board/index.php?PHPSESSID=d23245e28ff6e99889e99b38593d683c&topic=10497.0
Thank you

hfheatherfox07

This guy has crazy values for them here : http://code.google.com/p/analog-box/source/browse/abox/trunk/system/win32A_imp.inc?r=22#5029

by the way you could down load the whole source code for this MASM example

he has:

  ;// Notifications when Open or Save dialog status changes
        CDN_INITDONE            EQU 0FFFFFDA7h
        CDN_SELCHANGE           EQU 0FFFFFDA6h
        CDN_FOLDERCHANGE        EQU 0FFFFFDA5h
        CDN_SHAREVIOLATION      EQU 0FFFFFDA4h
        CDN_HELP                EQU 0FFFFFDA3h
        CDN_FILEOK              EQU 0FFFFFDA2h
        CDN_TYPECHANGE          EQU 0FFFFFDA1h

Gunner

From CommDlg.h
Quote#define CDN_FIRST   (0U-601U)
#define CDN_LAST    (0U-699U)

// Notifications from Open or Save dialog
#define CDN_INITDONE            (CDN_FIRST - 0x0000)
#define CDN_SELCHANGE           (CDN_FIRST - 0x0001)
#define CDN_FOLDERCHANGE        (CDN_FIRST - 0x0002)
#define CDN_SHAREVIOLATION      (CDN_FIRST - 0x0003)
#define CDN_HELP                (CDN_FIRST - 0x0004)
#define CDN_FILEOK              (CDN_FIRST - 0x0005)
#define CDN_TYPECHANGE          (CDN_FIRST - 0x0006)
#if (NTDDI_VERSION >= NTDDI_WIN2K)
#define CDN_INCLUDEITEM         (CDN_FIRST - 0x0007)
#endif // (NTDDI_VERSION >= NTDDI_WIN2K)


#define CDM_FIRST       (WM_USER + 100)
#define CDM_LAST        (WM_USER + 200)

So who knows where that person gotten those values from.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

jj2007

Quote from: Gunner on March 12, 2012, 11:05:10 PM
So who knows where that person gotten those values from.

From CommDlg.h?

include \masm32\include\masm32rt.inc
Crazy_INITDONE EQU 0FFFFFDA7h
Crazy_SELCHANGE EQU 0FFFFFDA6h
Crazy_FOLDERCHANGE EQU 0FFFFFDA5h
Crazy_SHAREVIOLATION EQU 0FFFFFDA4h
Crazy_HELP EQU 0FFFFFDA3h
Crazy_FILEOK EQU 0FFFFFDA2h
Crazy_TYPECHANGE EQU 0FFFFFDA1h

CDx_FIRST = -601
CDx_INITDONE =(CDx_FIRST - 0000)
CDx_SELCHANGE = (CDx_FIRST - 0001)
CDx_FOLDERCHANGE = (CDx_FIRST - 0002)
CDx_SHAREVIOLATION =(CDx_FIRST - 0003)
CDx_HELP = (CDx_FIRST - 0004)
CDx_FILEOK = (CDx_FIRST - 0005)
CDx_TYPECHANGE = (CDx_FIRST - 0006)

.code
start:
print str$(Crazy_INITDONE), 9
print str$(CDx_INITDONE), 13, 10
print str$(Crazy_FOLDERCHANGE), 9
print str$(CDx_FOLDERCHANGE), 13, 10
print str$(Crazy_FILEOK), 9
print str$(CDx_FILEOK), 13, 10
inkey "ok"
exit
end start


-601    -601
-603    -603
-606    -606