News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Enabling,Dissabling?

Started by trodon, November 18, 2006, 07:24:44 PM

Previous topic - Next topic

trodon

HI, one question...
what api can i use when i want to dissable some button from my Dialog, and what to enable?

TNick

Well, I didn't use dialogs so I'm not shure that this would help, but you can use EnableWindow for any window (as long as you know it's handle).

Regards,
Nick

trodon

hi TNick, thanks for answering.
No, i was try to use EnableWindow but failed, thats only for Window,Dialog

anyone sugest something?

jdoe

Quote from: trodon on November 18, 2006, 07:50:25 PM
hi TNick, thanks for answering.
No, i was try to use EnableWindow but failed, thats only for Window,Dialog

anyone sugest something?


EnableWindow work for windows and controls.


invoke EnableWindow, hButton, FALSE  ; or TRUE


If it fails, the problem must be elsewhere.

::)



Tedd

invoke SendDlgItemMessage, hDlg,IDB_BTN,WM_ENABLE,FALSE,NULL

..or..

invoke GetDlgItem, hDlg,IDB_BTN
invoke SendMessage, eax,WM_ENABLE,FALSE,NULL


..or..

invoke GetDlgItem, hDlg,IDB_BTN
invoke EnableWindow, eax,FALSE

(which just calls the SendMessage as above.)



Replace the FALSE with TRUE, to enable - obviously :wink
No snowflake in an avalanche feels responsible.

Ehtyar

WM_ENABLE is a notification, not a message: LINK.
Here is a small function i use in my own applications:

EnableControl PROC hWnd:HWND, nIDDlgItem:DWORD, bEnable:DWORD
invoke GetDlgItem, hWnd, nIDDlgItem
invoke EnableWindow, eax, bEnable
ret
EnableControl ENDP


Hope this helps, Ehtyar.

trodon

well i must say thank you all  :U