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. About the WM_ENABLE?

About the WM_ENABLE?

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 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.
  • Z Offline
    Z Offline
    zhaopzhi
    wrote on last edited by
    #1

    To make the control of IDC_RADIO1 to be enabled state,I tried SendDlgItemMessage and EnableWindow respectively.The result is the statement "EnableWindow(GetDlgItem(hDlg,IDC_RADIO1),TRUE);" succeeds, but the " SendDlgItemMessage( hDlg, IDC_RADIO1, WM_ENABLE, (WPARAM)0L, (LPARAM)0L );" is failing! Why??? The following is my codes: // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: case IDCANCEL: EndDialog(hDlg, LOWORD(wParam)); return TRUE; case IDC_BUTTON1: //SendDlgItemMessage( hDlg, IDC_RADIO1, WM_ENABLE, (WPARAM)TRUE, (LPARAM)0L );//fail! EnableWindow(GetDlgItem(hDlg,IDC_RADIO1),TRUE);//succeed. //SendDlgItemMessage( hDlg, (int)IDC_BUTTON2, WM_ENABLE, (WPARAM)0L, (LPARAM)0L );//fail! //SendMessage(GetDlgItem(hDlg,IDC_RADIO1), WM_ENABLE, (WPARAM)0L, (LPARAM)0L );//fail! break; } break; } return FALSE; } Rap off for you,for me,for our human.

    W 1 Reply Last reply
    0
    • Z zhaopzhi

      To make the control of IDC_RADIO1 to be enabled state,I tried SendDlgItemMessage and EnableWindow respectively.The result is the statement "EnableWindow(GetDlgItem(hDlg,IDC_RADIO1),TRUE);" succeeds, but the " SendDlgItemMessage( hDlg, IDC_RADIO1, WM_ENABLE, (WPARAM)0L, (LPARAM)0L );" is failing! Why??? The following is my codes: // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: case IDCANCEL: EndDialog(hDlg, LOWORD(wParam)); return TRUE; case IDC_BUTTON1: //SendDlgItemMessage( hDlg, IDC_RADIO1, WM_ENABLE, (WPARAM)TRUE, (LPARAM)0L );//fail! EnableWindow(GetDlgItem(hDlg,IDC_RADIO1),TRUE);//succeed. //SendDlgItemMessage( hDlg, (int)IDC_BUTTON2, WM_ENABLE, (WPARAM)0L, (LPARAM)0L );//fail! //SendMessage(GetDlgItem(hDlg,IDC_RADIO1), WM_ENABLE, (WPARAM)0L, (LPARAM)0L );//fail! break; } break; } return FALSE; } Rap off for you,for me,for our human.

      W Offline
      W Offline
      Weiye Chen
      wrote on last edited by
      #2

      From msdn: The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. So i think WM_ENABLE is like a notification message and its handler isn't really responsible for changing the state of the control. Weiye Chen When pursuing your dreams, don't forget to enjoy your life...

      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