Author Topic: Enabling/Disabling controls during run time  (Read 2619 times)

K_F

  • Member
  • *****
  • Posts: 1345
  • Anybody out there?
Enabling/Disabling controls during run time
« on: March 20, 2013, 06:19:47 PM »
Hi Ramon
Playing with a combo box, but cannot see where to enable or disable it. There is no specific API for this so I'd imagine I'd have to set the enable property on the window handle.

Would this be the case, and is this handle the one you get from the GetWindowHandle proc ?

Thanks
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

ragdog

  • Member
  • ****
  • Posts: 572
Re: Enabling/Disabling controls during run time
« Reply #1 on: March 20, 2013, 07:26:29 PM »
Code: [Select]

invoke GetDlgItem,hWnd,IDC_CONTROL_ID
invoke EnableWindow,eax,FALSE

FALSE =Disable
TRUE  = Enable

rsala

  • Moderator
  • Member
  • *****
  • Posts: 262
    • Easy Code
Re: Enabling/Disabling controls during run time
« Reply #2 on: March 21, 2013, 06:03:50 AM »
Hi K_F,

As radgog said, you have to use the EnableWindow API function. You can get the handle with the GetWindowItem EC method or with the GetDlgItem API function.
EC coder

K_F

  • Member
  • *****
  • Posts: 1345
  • Anybody out there?
Re: Enabling/Disabling controls during run time
« Reply #3 on: March 22, 2013, 08:48:00 AM »
Thanks guys..
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'