Announcement

Collapse
No announcement yet.

Detecting Button Disabled

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting Button Disabled

    I'm using the following to click buttons

    CONTROL POST CBHNDL, %Button1, %BM_CLICK, 0, 0

    The only problem is that the Callback receives the click message even when the button is disabled.

    How can I read the status of the button first to see if it's disabled?

  • #2
    API Explanation
    IsWindowEnabled determines if a window is currently enabled or disabled. If a window is disabled, it cannot receive the focus and will ignore any attempted input. Many types of windows, such as buttons and other controls, will appear grayed when disabled. The function returns 0 if the window is disabled, or a non-zero value if the window is enabled.

    Comment


    • #3
      Thanks Jules.

      Solution

      Code:
      IF ISTRUE(IsWindowEnabled(GetDlgItem(CBHNDL,%Button1))) THEN
         CONTROL POST CBHNDL, %Button1, %BM_CLICK, 0, 0
      END IF

      Comment

      Working...
      X