Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Not so brilliant me

Not so brilliant me

Scheduled Pinned Locked Moved The Weird and The Wonderful
business
4 Posts 4 Posters 16 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Haroon Sarwar
    wrote on last edited by
    #1

    One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with: if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } } as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes:

    S V S 3 Replies Last reply
    0
    • H Haroon Sarwar

      One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with: if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } } as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes:

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      :rolleyes:;P

      Regards, Sylvester G sylvester_g_m@yahoo.com

      1 Reply Last reply
      0
      • H Haroon Sarwar

        One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with: if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } } as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes:

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        :)

        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

        1 Reply Last reply
        0
        • H Haroon Sarwar

          One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with: if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } } as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes:

          S Offline
          S Offline
          Sathesh Sakthivel
          wrote on last edited by
          #4

          :)

          Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups