The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
July 31, 2021, 09:47:27 PM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  General Forums
| |-+  The Campus
| | |-+  Windows Explorer-style "browse for file" window
« previous next »
Pages: 1 2 3 [4] 5 Print
Author Topic: Windows Explorer-style "browse for file" window  (Read 36774 times)
dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #45 on: February 15, 2012, 09:36:48 PM »

thanks, Jochen

funny you should say that about details, youngest on top
i have that exact setting as my default mode in explorer   Tongue
it took a little getting used to - and sometimes, i have to change it to alpha-name, but i like it so far
Logged
jj2007
Member
*****
Gender: Male
Posts: 6011



Re: Windows Explorer-style "browse for file" window
« Reply #46 on: February 15, 2012, 10:45:53 PM »

funny you should say that about details, youngest on top
i have that exact setting as my default mode in explorer   Tongue

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

dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #47 on: February 15, 2012, 11:24:19 PM »

well i sent a message...
Code:
        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   Tongue
i was playing with LVM_UPDATE and LVM_REDRAWITEMS, but i am not sure what to use for wParam and lParam
Logged
dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #48 on: February 15, 2012, 11:36:15 PM »

well - this is kinda hokee, but it does work   Tongue

Code:
        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
Logged
jj2007
Member
*****
Gender: Male
Posts: 6011



Re: Windows Explorer-style "browse for file" window
« Reply #49 on: February 16, 2012, 12:57:00 AM »

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

dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #50 on: February 16, 2012, 02:26:53 AM »

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

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
Logged
dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #51 on: February 16, 2012, 02:39:24 AM »

that works - thanks, JJ   ThumbsUp

let me do some cleanup, then i'll post
Logged
dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #52 on: February 16, 2012, 03:18:01 AM »

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   ThumbsUp

* SmallOFN4.zip (17.24 KB - downloaded 319 times.)
Logged
jj2007
Member
*****
Gender: Male
Posts: 6011



Re: Windows Explorer-style "browse for file" window
« Reply #53 on: February 16, 2012, 06:17:33 AM »

that works - thanks, JJ   ThumbsUp

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
Logged

dedndave
Member
*****
Posts: 12523


Re: Windows Explorer-style "browse for file" window
« Reply #54 on: February 16, 2012, 06:32:52 AM »

that sets the style for the listview control
i take it the WM_COMMAND message takes care of that, then ?
Logged
raleeper
Member
*****
Gender: Male
Posts: 285


Re: Windows Explorer-style "browse for file" window
« Reply #55 on: March 10, 2012, 05:12:17 AM »

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
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Windows Explorer-style "browse for file" window
« Reply #56 on: March 12, 2012, 10:05:14 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
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Windows Explorer-style "browse for file" window
« Reply #57 on: March 12, 2012, 10:39:14 PM »

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
Logged
Gunner
Member
*****
Gender: Male
Posts: 687

What the hell, why not.


Re: Windows Explorer-style "browse for file" window
« Reply #58 on: March 12, 2012, 11:05:10 PM »

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.
Logged

~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com
jj2007
Member
*****
Gender: Male
Posts: 6011



Re: Windows Explorer-style "browse for file" window
« Reply #59 on: March 13, 2012, 12:12:23 AM »

So who knows where that person gotten those values from.

From CommDlg.h?

Code:
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

Code:
-601    -601
-603    -603
-606    -606
Logged

Pages: 1 2 3 [4] 5 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!