SHBrowseForFolder Subclassing.

I would like to change the name of the "cancel" button.  Is that
possible with Subclassing, Superclassing, etc.?
....Bruce

0
Bruce
12/7/2003 4:22:00 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
811 Views

Similar Articles

[PageSpeed] 11

Maybe this article can help you:
http://www.codeproject.com/dialog/browse_for_folder_dialog.asp

-- 
Mav Rossi

"Bruce Arnold" <b_a_r_n_o_l_d@b_l_a_s_t.n_e_t> ha scritto nel messaggio
news:cka5tv4rf6mq086b1nf6t6gom5rgds0a33@4ax.com...
> I would like to change the name of the "cancel" button.  Is that
> possible with Subclassing, Superclassing, etc.?
> ...Bruce
>
>


0
12/7/2003 9:21:53 AM
And this too:
http://www.codeproject.com/dialog/browse_for_folder_part_2.asp

-- 
Mav Rossi

"Bruce Arnold" <b_a_r_n_o_l_d@b_l_a_s_t.n_e_t> ha scritto nel messaggio
news:cka5tv4rf6mq086b1nf6t6gom5rgds0a33@4ax.com...
> I would like to change the name of the "cancel" button.  Is that
> possible with Subclassing, Superclassing, etc.?
> ...Bruce
>
>


0
12/7/2003 9:23:32 AM
Thanks to Y.Joshi and Mav Rossi for the help.  Here's part of my final
solution. Since I already had a callback function, I only had to add
two lines to the program to change the name of the Cancel button.  Now
the button says "No Change" on it which is more logical for the user.

INT CALLBACK CSyncDlg::BrowseCallbackProc(HWND hwnd, 
                             UINT uMsg, LPARAM lp,  LPARAM pData) 
  {
  switch(uMsg) 
    {
    case BFFM_INITIALIZED: 
      HWND m_Cancel_hwnd = FindWindowEx(hwnd,NULL,"BUTTON", "Cancel");
      if ( m_Cancel_hwnd) ::SetWindowText(m_Cancel_hwnd, "No Change");
      break;
    }
  return 0;
  }

On Sat, 06 Dec 2003 23:22:00 -0500, Bruce Arnold
<b_a_r_n_o_l_d@b_l_a_s_t.n_e_t> wrote:

>I would like to change the name of the "cancel" button.  Is that
>possible with Subclassing, Superclassing, etc.?
>...Bruce

0
Bruce
12/7/2003 2:58:40 PM
Reply:

Similar Artilces:

SHBrowseForFolder
I want to set the pidlRoot member of the BROWSEINFO structure to a default location. How do I get a PIDL from a path represented by a text string like this: _T("C:\Program Files")? Thanks I'm not certain about the pidl for an arbitrarily named folder, but if your real interest is the "Program Files" folder, then you shouldn't use a text string anyway, since the text is user-selectable and in fact changes based on language locales. For "Program Files" and other special folders, you can get the pidl using the SHGetFolderLocation function, passing in a CS...

SHBrowseForFolder Subclassing.
I would like to change the name of the "cancel" button. Is that possible with Subclassing, Superclassing, etc.? ....Bruce Maybe this article can help you: http://www.codeproject.com/dialog/browse_for_folder_dialog.asp -- Mav Rossi "Bruce Arnold" <b_a_r_n_o_l_d@b_l_a_s_t.n_e_t> ha scritto nel messaggio news:cka5tv4rf6mq086b1nf6t6gom5rgds0a33@4ax.com... > I would like to change the name of the "cancel" button. Is that > possible with Subclassing, Superclassing, etc.? > ...Bruce > > And this too: http://www.codeproject.com/dialog/browse...

SHBrowseForFolder question
Ok, I managed to get SHBrowseForFolder to work and it pops up its dialog box, but I would like to be able to use the info in a drop down combobox integrated into my dialog form. Is there a way to do this. What I have is a combobox that I want to show and select the path in, then a list box to display the files, and another combobox to select which drive. I have a specific reason to do it this way and I was wondering if I can use some of the info from the SHBrowseForFolder to do this. It seems like I should be able to, but I have not been able to find any helpful information on just how...

Dynamically Created CFormView subclass, Member Controls all have Hwnd = 0x000 ??
hi, i'm seriously stuck here, i have a tab control, that has a couple of "formview" dialog subclasses for each tab pane. now in each tab pane, depending on a variety of factors, i dynamically create a bunch of other sub-cformview subclasses and add them to the tab dialog my general technique is to add an element sub-cformview like so in OnInitialUpdate: CRuntimeClass* pRuntimeClass = RUNTIME_CLASS( some_sub_element ); CObject* pObject = pRuntimeClass->CreateObject(); if( pObject->IsKindOf( RUNTIME_CLASS( some_sub_element ) ) ) { CRect rect(ulx, uly + license_list.siz...

SHBrowseForFolder & BFFM_SETSELECTION
Hi everyone, I want to display a "Browse For Folder" dialog with a pre-selected folder. To do that I use a CALLBACK proc to send a BFFM_SETSELECTION message. //------------------------------------------// void MyBrowseForFolder () { BROWSEINFO bi; bi.lpfn = BrowseCallbackProc; //... initialisation of other BROWSEINFO members... //Display the dialog LPITEMIDLIST pItemIDList = SHBrowseForFolder (&bi); } //------------------------------------------// int CALLBACK BrowseCallbackProc (HWND hWnd, UINT Msg, LPARAM lParam, LPARAM lpData) { if (Msg == BFFM_INITIA...

SHBrowseForFolder (Resource file)
Hi, Is anybody know what is the file name of the resource file containing the dialog when calling the windows API fonction "SHBrowseForFolder" ? I look isome of the RC file present in the following folder "\cesysgen\oak\target\ARMV4I\retail\0409" but I did not found it :( I thought it was "shlwapi.res" but it seem to no. I need to modify it because on my device the height of the "SysListView32" control is too long. Also the OK and CANCEL button are outbout the screen. I also tried using FindWindows and MoveWindows API to move these ...

SHBrowseForFolder with initial UNC folder and no context menu?
I use SHBrowseForFolder() for selecting folders, but I don't want the context menu because it makes it too easy for novice users to rename folders etc. 1: SHBrowseForFolder() without BIF_NEWDIALOGSTYLE don't have a context menu, but doesn't work well with an initial UNC-path (see: http://www.eggheadcafe.com/software/aspnet/29634013/shbrowseforfolder-questio.aspx) 2: SHBrowseForFolder() with BIF_NEWDIALOGSTYLE have the not wanted context menu but works well with initial UNC-path. Is there a way to either: A) Make "1:SHBrowseForFolder() without BIF_NEWDIALOGSTYLE" w...

Trouble subclassing CEdit and OnChar
I'm trying to create a subclassed CEdit to do some input filtering. One thing that I want to do is convert spaces to underscores. I tried just modifying the nChar value that I'm passing to CEdit::OnChar, but the original character (space) goes through instead of the character I'm substituting. How do I substitute one input character for another in a Subclassed CEdit? Code: void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { if (nChar == VK_SPACE) nChar = '_'; // Limit entry to alphanumeric and the underscore if (isalnum(nChar) || (nChar == '_') ||...

weird SHBrowseForFolder problem
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_USENEWUI; bi.ulFlags |= BIF_EDITBOX | BIF_VALIDATE; ....suddenly has issues on updated Win2K systems. I'm sure it does. I'm equally sure we could be of more assistance if you could describe what you mean by "issues". joe On Wed, 14 Jun 2006 16:31:16 -0700, flect <flect@example.net> wrote: > bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_USENEWUI; > bi.ulFlags |= BIF_EDITBOX | BIF_VALIDATE; > >...suddenly has issues on updated Win2K systems. Joseph M. Newcomer [MVP] email: n...

SHBrowseForFolders and path strings
I have a CString variable that stores the last folder opened in the app. The registry key stored the path with dots added (Windows XP) as "C:\Program Files\IView\My Projects\Images...". My question is, must I always trim extra characters from the strings be for writing to registry? Thanks, Mark I think what you are seeing is the fact that regedit cannot display the string and displays the dots. If you double click the entry does it show the correct path. If you put .... in front of the path then the path is useless. AliR. "Mark F." <reply2group@nospam.com>...

SHBrowseForFolder Question C++
I tried to use the BIF_USENEWUI and BIF_NEWDIALOGSTYLE style keywords but I always get that those two are undeclared identifiers. I need to get a select new folder icon up on the SH BrowseForFolder and have read the other messages on here about that and haven't been able to come up with a solution. Does anybody know why these would be undeclared identifiers, are they just C# related or am I missing something. I am using MS Visual Studio C++ 6.0 Here's what I did in my code: #ifndef BIF_NEWDIALOGSTYLE #define BIF_NEWDIALOGSTYLE 0x0040 #endif and #define BIF_USENEWUI (BIF_NEWDI...

SHBrowseForFolder parent window
I'm developing an application in C++ using VS.net. I need a browser to return a folder that the user selects. SHBrowseForFolder seems to do the trick in most instances. I have one place that it fails. During the CWinApp::InitInstance() method the m_hWnd of the main window's parent frame window (GetMainWindow()->GetParentFrame()->m_hWnd;) is not setup yet. The BrowseInfo::hwndOwner requires it. When I create a CDialog at this point it only requires a pointer to the CFrameWnd and it works fine. Any ideas how I can get around this? Thanks, Neil On Fri, 13 May 2005 14:15:20...

dynamically created subclassed CComboBox doesnot recieve CBN_SELCHANGE in Activex Control
hi, Please ignore this post if a similar one appears. I posted yesterday and the post has not appeared on the NG yet. That said, let me explain the problem : I subclassed the CComboBox and am placing it on a CToolBar derivative. Both the combobox and the toolbar are created dynamically. I wish to trap the CBN_SELCHANGE message of the combobox and do some action in there. But the combobox doesnot seem to recieve the message (more precisely, the handler is never called).All this is in a classwizard generated MFC based Activex Control. Here is what I do: 1. In the main COleControl deri...

SHBrowseForFolder mapped drives names
Hello, I spotted a strange problem when using SHBrowseForFolder dialog. For mapped drives it always displays appropiate contents, but the name is not always up-to-date. If my program is running and I change the mapped directory to point to some other location and give it a new name but use one of previously defined drive letters, the name in SHBrowseForFolder for this drive letter remains unchanged until I close the program and run it once again. Does anybody know how to refresh the dialog so that it contains appropiate drive names? Thx JarekZPl P.S. I use visual c++ 6 and windows xp ...

SHBrowseForFolder, BIF_NEWDIALOGSTYLE, & BIF_STATUSTEXT
WinXP SP2, VC++ 6.0 SP5 I've been using the old style SHBrowseForFolder and BIF_STATUSTEXT for years with no problems. Now I want to add the "Create New Folder" button so I added BIF_NEWDIALOGSTYLE to the BROWSEINFO flags. Now the dialog is displayed with the "Create New Folder" button but the status text has disappeared. If I remove BIF_NEWDIALOGSTYLE the status text appears again. The only other thing I've noticed is that the dialog area between the bottom of the Title Bar and the top of the directory tree window is smaller with BIF_NEWDIALOGSTYLE than ...

Subclassing in property pages
I have tree-like combo box subclassed in my property page (derived from CPropertyPage). It works fine until I drop list and move property sheet, then drop down list stays at the same place whilst rest of dialog (property sheet) was moved. I guess that this is something with ownership but how to fix it. This is how I subclass combo: BOOL ParentSettings::OnInitDialog() { CPropertyPage::OnInitDialog(); ctlComboTree.SubclassDlgItem(IDC_PARENTS, this); return (TRUE); } ParentSettings class is derived from CPropertyPage. I created dialog associated with property pade using resource ...

Notification when renaming directory in SHBrowseForFolder?
Hi, I use SHBrowseForFolder with the flags BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE so that I can create a new subdirectory or rename an existing directory. I'd also like to show the directory currently selected in the static control above the treeview. When selecting another directory my callback function is being called and I can set the window text of the static control. Works like a charme. However when I just rename a directory in the treeview, then the callback function is not being called, allthough the directory currently selected has changed it's name. Any idea how to reflec...

Subclassing CTreeCtrl in CTreeView
I want to use a derived CTreeCtrl in a CTreeView and suppose I must subclass the usual CTreeCtrl to achieve that. How can I subclass the CTreeCtrl (and where should I put the subclassing code)? An example would help much of course "JackRnl" <Hccnet@Runit.Scarlet.nl> wrote in message news:bf9dcf$5jb$1@news.hccnet.nl... > I want to use a derived CTreeCtrl in a CTreeView and suppose I must subclass > the usual CTreeCtrl to achieve that. > How can I subclass the CTreeCtrl (and where should I put the subclassing > code)? > An example would help much of course Jack...

SHBrowseForFolder function broken in Win7
I use the SHBrowseForFolder function with .ulFlags =3D = BIF_RETURNONLYFSDIRS to get a pick folder dialog (network Shared folders). It works fine in XP but in Win7 = and I assume Vista it opens a dialog with no entries, no errors. I wasted a lot of time = establishing there were truly some shared folders with full rights on the Win7 machine and = also on a networked XP machine. The XP machine can see and does allow selecting the shared folder on the = Win7 machine using SHBrowseForFolder. Win7 PC doesn't see any shared folders at all. It shows a top level item = called Net...

How to get full directory path from SHBrowseForFolder()
Does anyone know how to get the full directory path from the return value of SHBrowseForFolder()? Thanks, Ivan hi did you tried the code i posted earlier.. esle find here hi try the following snippet code BROWSEINFO binfo; char szFolder[MAX_PATH]; CString csCaption; csCaption="Select Destination folder "; memset(&binfo,0,sizeof(binfo)); binfo.hwndOwner=m_hWnd; binfo.pszDisplayName=szFolder; binfo.lpszTitle=csCaption; binfo.ulFlags=BIF_RETURNONLYFSDIRS; LPITEMIDLIST pidl=SHBrowseForFolder (&binfo); int iRet=SHGetPathFromIDList(pidl,szFolder); // The varibal...

SHBrowseForFolder(&bi) How do I set the initial directory
As the subject says how do I Open up the directoy tree to an initial directory? Thanks >As the subject says how do I Open up the directoy tree to an initial directory? Here's an old example that's been posted on the newsgroups before: Use a callback, and respond to BFFM_INITIALIZED by sending a BFFM_SETSELECTION message with the directory you want. E.g. // SetSelProc // Callback procedure to set the initial selection of the browser. int CALLBACK SetSelProc( HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData ) { if (uMsg==BFFM_INITIALIZED) { ::SendMess...

Re: Subclassing
Hi All I wish to create my own control for subclassing. The control will essentially contain some simple text and some minor graphics. No real control functionality is required. The question is should I derive this new control from an existing control, say CButton, or directly from CWnd? Thanks in advance LarryM wrote: > Hi All > > I wish to create my own control for subclassing. The control will > essentially > contain some simple text and some minor graphics. No real control > functionality is required. > > The question is should I derive this new control...

SHBrowseForFolder and "Application Data" folder
Hi, Is there some way to get a directory listing in SHBrowseForFolder that shows hidden folders or "Application Data" folder? m. You need to enable view of hidden/system files/folders before listing them with SHBrowseForFolder. Look at IShellView interface. -- Vladimir "m.wski21.usunto@aust.com" <m.wski21@gazeta.pl> wrote in message news:1138196555.388533.200290@z14g2000cwz.googlegroups.com... > Hi, > > Is there some way to get a directory listing in SHBrowseForFolder that > shows hidden folders or "Application Data" folder? > > m....

Subclassed CEdit needs OnClose
I have a subclassed CEdit control. I need to GetWindowText() just before the CEdit is destroyed, but can't figure out where to do this. I've tried OnDestroy() (doesn't get called), my destructor (the m_hWnd is no longer valid), OnClose() (doesn't get called), etc. Thanks, Steve Could you grab the text in a OnKillFocus() handler? That way you'd get a message when they move off of the control as well as when it is destroyed. Just a thought. Tom "Steve" <junk@bruff.com> wrote in message news:97327c0.0309251221.35c93d02@posting.google.com... > I have...

questionn about subclass.
In a Dialog. Define these 2 member: CButton m_btnOld; CMyButton m_btnMy; Add these code in OnInitDialog: CRect rectBtn(300,10,350,40); m_btnOld.Create(_T("asdfas"),WS_CHILD|WS_VISIBLE,rectBtn,this,3000); m_btnMy.SubclassDlgItem(3000,this); I got a assert when it run to " m_btnMy.SubclassDlgItem(3000,this);" the assert is: ASSERT(FromHandlePermanent(hWndNew) == NULL); is this method right? if not, how shall I do? thanks a lot! "rokia" <rokiadd@yahoo.com.cn.discuss> wrote in message news:%23iJRUSWbEHA.3524@TK2MSFTNGP12.phx.gbl... > In a...