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. General Programming
  3. C / C++ / MFC
  4. Disabling a button using ATL

Disabling a button using ATL

Scheduled Pinned Locked Moved C / C++ / MFC
c++comquestion
4 Posts 3 Posters 0 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.
  • J Offline
    J Offline
    JC Gauthier
    wrote on last edited by
    #1

    Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control : // Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0); and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/

    C M 2 Replies Last reply
    0
    • J JC Gauthier

      Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control : // Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0); and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/

      C Offline
      C Offline
      Caddy
      wrote on last edited by
      #2

      I going to show you a way to solve all you problems Get WTL, in it there is a AtlCtrls.h file, in that there are all the standard controls like CButton Not only is it easy to use but if you look at the code it wraps the SendMessage stuff. Also has a CString class and Arrays which allows you not to use MFC and it makes things smaller. Once you've used WTL you'll never go back to MFC WTL is hard to find and I dont have the MSDN site, ask the ATL newsgroup they will know LostGolfBall

      1 Reply Last reply
      0
      • J JC Gauthier

        Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control : // Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0); and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        See the FAQ 4.6 How do I enable or disable a dialog control (button, edit box, etc.)?[^] --Mike-- Latest blog entry: *drool* (Alyson) [May 10] Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber "You have Erica on the brain" - Jon Sagara to me

        J 1 Reply Last reply
        0
        • M Michael Dunn

          See the FAQ 4.6 How do I enable or disable a dialog control (button, edit box, etc.)?[^] --Mike-- Latest blog entry: *drool* (Alyson) [May 10] Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber "You have Erica on the brain" - Jon Sagara to me

          J Offline
          J Offline
          JC Gauthier
          wrote on last edited by
          #4

          Excellent ! This is exactly what I was looking for :-D Thanks for your input. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/

          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