Click here to Skip to main content
15,920,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Should i use a progress control? Pin
keegan12-Aug-03 8:59
keegan12-Aug-03 8:59 
Generalgot it Pin
keegan12-Aug-03 9:08
keegan12-Aug-03 9:08 
GeneralRe: got it Pin
John M. Drescher12-Aug-03 9:16
John M. Drescher12-Aug-03 9:16 
GeneralCFileDialog Pin
will138312-Aug-03 7:54
will138312-Aug-03 7:54 
GeneralRe: CFileDialog Pin
Heath Stewart12-Aug-03 8:51
protectorHeath Stewart12-Aug-03 8:51 
GeneralRe: CFileDialog Pin
will138312-Aug-03 9:11
will138312-Aug-03 9:11 
GeneralRe: CFileDialog Pin
will138312-Aug-03 9:46
will138312-Aug-03 9:46 
GeneralRe: CFileDialog Pin
Heath Stewart12-Aug-03 10:46
protectorHeath Stewart12-Aug-03 10:46 
Okay, then there is several options you can do to really fix the CFileDialog. The following alternative uses MFC's CFileDialog (since that seems to be what you want to use), but you could just as easily use the method that it wraps, GetOpenFileName.

First, create an instance of the CFileDialog. When you've done that, get the m_ofn member struct from the instance and perform the following.

  1. OR the Flags member of the OPENFILENAME structure with OFN_ENABLEHOOK. You might also want to OR it with OFN_NODEREFERENCELINKS while you're at it to keep users from making a shortcut to a location outside your limited scope.
  2. Set the lpfnHook to a HOOKPROC callback.

From there, your options are many. In WM_INITDIALOG, you could simply remove the the "Up" button entirely based by getting the toolbar in which its contained (based, perhaps, on the window class for the toolbar which Spy++ can give you, which is ToolbarWindow32, or getting it based on the tooltip or some other identifier) or handling the message generated when you click the up button. Spy++ reports this as either WM_USER+300 (aka 1) or WM_USER+302 (aka 2) (both were posted as 1211 (based on aforementioned aliases). What those mean you'll have to dig-up. All the other messages were mostly painting and mouse messages - nothing that would seem to help.

It's surprising that handling the click messages and returning true didn't help. Did you handle WM_LBUTTONUP? That directory change is triggered then and not during WM_LBUTTONDOWN. Just out of curiosity, how did you determine if the "Up" button was being clicked?

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralOLE DB record counting Pin
João Paulo Figueira12-Aug-03 7:43
professionalJoão Paulo Figueira12-Aug-03 7:43 
GeneralRe: OLE DB record counting Pin
Jörgen Sigvardsson12-Aug-03 13:37
Jörgen Sigvardsson12-Aug-03 13:37 
GeneralRe: OLE DB record counting Pin
João Paulo Figueira12-Aug-03 22:41
professionalJoão Paulo Figueira12-Aug-03 22:41 
GeneralRe: OLE DB record counting Pin
Jörgen Sigvardsson12-Aug-03 22:46
Jörgen Sigvardsson12-Aug-03 22:46 
GeneralRe: OLE DB record counting Pin
João Paulo Figueira24-Aug-03 22:14
professionalJoão Paulo Figueira24-Aug-03 22:14 
GeneralRe: OLE DB record counting Pin
Jörgen Sigvardsson25-Aug-03 0:46
Jörgen Sigvardsson25-Aug-03 0:46 
GeneralRe: OLE DB record counting Pin
João Paulo Figueira25-Aug-03 1:01
professionalJoão Paulo Figueira25-Aug-03 1:01 
GeneralCrystal Report Viewer Pin
Archigal12-Aug-03 6:28
Archigal12-Aug-03 6:28 
GeneralRe: Crystal Report Viewer Pin
Heath Stewart12-Aug-03 8:47
protectorHeath Stewart12-Aug-03 8:47 
GeneralRe: Crystal Report Viewer Pin
Jörgen Sigvardsson12-Aug-03 13:39
Jörgen Sigvardsson12-Aug-03 13:39 
GeneralCSocket Pin
MemLeak12-Aug-03 6:25
MemLeak12-Aug-03 6:25 
GeneralRe: CSocket Pin
valikac12-Aug-03 6:51
valikac12-Aug-03 6:51 
GeneralInserting metafiles in RichEdit Pin
Trapper12-Aug-03 6:08
Trapper12-Aug-03 6:08 
Generalprogram access to locked directory Pin
IdUnknown12-Aug-03 5:31
IdUnknown12-Aug-03 5:31 
GeneralRe: program access to locked directory Pin
Steve S12-Aug-03 5:43
Steve S12-Aug-03 5:43 
GeneralUsing old Visual Studio 6 Lib/dlls Pin
Dirk Vandenheuvel12-Aug-03 4:44
Dirk Vandenheuvel12-Aug-03 4:44 
GeneralMFC question Pin
Beer2612-Aug-03 4:28
Beer2612-Aug-03 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.