Archive: Is it possible to disable a MessageBox's button ??


Is it possible to disable a MessageBox's button ??
Hello,

I am including a very important message box in my installer, and I would be sure that the user red the message before clicking "OK".

I configured the default button on "Cancel", but I think it's not enought.

The better would be to disable the "OK" button, sleep the installer during few seconds end then, enable it.

But I can't find how to access to the "OK" button of a messageBox with GetDlgItem, do you have an idea ?

Thank you very much


No one can say if it is possible or not ?


it might be possible..somehow, but NSIS code execution basically 'halts' as soon as the messagebox pops up - so there's no easy way to disable any button on it afterward.

some of the banner plugins might be what you need, or a custom dialog, or (Anders would know), maybe you can do what you need with the subclassing plugin.


to do this, you would probably need a hook + subclassing, see http://www.codeproject.com/KB/cpp/dMsgBox.aspx and to do this you probably need to write a plugin because I don't think the system plugin can do hooks.

Its probably possible to do this with just my subclass plugin by waiting for WM_ACTIVATE, but that would be a bit fragile if the user switched to another app just before your MessageBox

There is already a messagebox plugin, but I don't know if it supports a wait feature, but you might want to check that out first