MessageBoxes using DTF

时光怂恿深爱的人放手 提交于 2019-11-30 18:17:38

问题


The MsiProcessMessage function doco on MSDN shows this example:

PMSIHANDLE hInstall;
PMSIHANDLE hRec;
MsiProcessMessage(hInstall, 
                  INSTALLMESSAGE(INSTALLMESSAGE_ERROR|MB_ABORTRETRYIGNORE|MB_ICONWARNING),
                  hRec);

How would this be done using Session.Message in DTF? The only overload takes Session.InstallMessage as an argument. I see the MessageBoxButtons enum and I convert both types to In32 and perform a logical or but I'm not sure how to get this back into the API.

Am I missing something or is DTF missing something?


回答1:


I've not done much with DTF but my understanding is that you'd want something like:

Session.Message(InstallMessage.Error | 
                (InstallMessage)((int)MessageButtons.AbortRetryIgnore |
                                 (int)MessageIcon.Warning), 
                record);

Not very pretty. I've formatted the messageType agument to fit better in the text box here. Format in your code as per your coding guidelines. :)



来源:https://stackoverflow.com/questions/16124164/messageboxes-using-dtf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!