You have to provide more detailed information about your problem.
You can go to CodeGuru and lookup FAQ for reasons why not to use
PreTranslateMessage. See questions about how to suppress Enter key from
closing a dialog.
--
RainMan
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
I suspect the nub of the probem lies in the fact that your class is not the
hierarchical parent of the dialog that you see on the screen. To put it
another way, your class actually becomes a child of the file open dialog
window. Use Spy to look at the hierarchy and you'll see what I mean. It
appears that the real dialog window (which I assume does get the message)
examines the various messages and decides to whom it should pass on
messages.
But that's just off the top of my head.
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:eEU9Q1bn...@TK2MSFTNGP09.phx.gbl...
If you'll open a windows standard File Dialog and set the focus on the
listcontrol(where the folders and files are shown), and than you press the
Back_Space button, the list control will change directory to the parent one,
another press on the Backspace button will again take you to the parent
directory and so on.
What I want to do in my derived CFileDialog is to enable the user to go up
one level(directory), until a specific directory, Hence limit the user
capability to go to up level until the root directory.
I want to limit the user directories to choose a file from.
I hope it is clear enough.
Thanks,
Janiv Ratson.
"KMA" <k...@chum.com> wrote in message news:ddeooo$eh8$1...@atlas.ip-plus.net...
Then you could be in luck. The real parent dialog does send some useful
messages to your class, one of which is overriden as OnFolderChange. At
least in this handler you get to find out when the user has tried to change
folder. I guess you can trap this and take action to prevent access to
particular folders. I haven't actually tested this.
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:Oi9MqCk...@TK2MSFTNGP09.phx.gbl...
"KMA" <k...@chum.com> wrote in message news:ddeuvh$eud$1...@atlas.ip-plus.net...
Then you need to hook this window/ctrl in order to intercept the
WM_KEYDOWNs. When you get VK_BACK as an input paramter you need to fugure if
the user is allowed to go up one dir and either call the default
functionality or not accordingly.
Do bear in mind that the listctrl is held within a container, so to locate
it you have to do a bit of jiggery pokkery through the dialog hieracrchy,
but Spy will show you where it is.
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:uElSwGln...@tk2msftngp13.phx.gbl...
"KMA" <k...@chum.com> wrote in message news:ddf49f$f9b$1...@atlas.ip-plus.net...
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:OU4y0Tln...@TK2MSFTNGP09.phx.gbl...
You may have better luck with SHBrowseForFolder, in the mode when it display
files. You can set a tree root for that dialog.
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:Oi9MqCk...@TK2MSFTNGP09.phx.gbl...
"Alexander Grigoriev" <al...@earthlink.net> wrote in message
news:%230NK7d0...@TK2MSFTNGP12.phx.gbl...
extern HINSTANCE ghConfigToolCommonInstance; //the dll instance
LRESULT CALLBACK MyOwnMessageProc( int code, // hook code
WPARAM wParam, // not used
LPARAM lParam) // message data
{
if (code == MSGF_DIALOGBOX)
{
MSG *pmsg = (MSG*)lParam;
switch (pmsg->message)
{
case WM_KEYDOWN:
if(pmsg->wParam == VK_BACK)
{
TRACE(_T("Backspace is pressed!\n"));
return 1; //Do not process Message
}
break;
}
}
return 0;
}
CDerivedFileDialog::OnInitDialog:
SetWindowsHookEx(WH_SYSMSGFILTER,MyOwnMessageProc,ghConfigToolCommonInstance,0);
"Janiv Ratson" <ja...@aoe6.net> wrote in message
news:eEU9Q1bn...@TK2MSFTNGP09.phx.gbl...