After two seconds, the OK button should be enabled again.
The following code half-works, but if you uncomment the lines,
you'll see that it fails miserably. This is because the OK button
is only getting disabled by repeated calls of EnableWindow_(),
due to the thread running. I tried pausing/resuming the thread
but then the OK button is enabled after pausing. It's weird.
And yes, I know about "just use a custom window". I don't want
to, and besides, I want to know if a MessageBox can do it.
Code: Select all
Procedure MessageBoxDisabledThread(null)
Repeat
Sleep_(1)
mb=FindWindow_(0,"Hello")
If mb
ok=GetWindow_(mb,#GW_CHILD)
EnableWindow_(ok,0)
;Sleep_(2000)
;EnableWindow_(ok,1)
EndIf
ForEver
EndProcedure
CreateThread(@MessageBoxDisabledThread(),0)
MessageBox_(0,"This is the body","Hello",#MB_ICONINFORMATION)