45fan.com - 路饭网

搜索: 您的位置主页 > 电脑频道 > 电脑教程 > 阅读资讯:InstallShield自定义对话框介绍

InstallShield自定义对话框介绍

2016-09-02 15:29:24 来源:www.45fan.com 【

InstallShield自定义对话框介绍

/*------------------------------------------------------------------------*/

/* */

/* Function: CheckSQLServerDSNInputValid */

/* */

/* Descrip: check the input data is valid. */

/* do not need to check the pwd if empty */

/* Misc: */

/* */

/*------------------------------------------------------------------------*/

function CheckSQLServerDSNInputValid(hwndDlg, bAllowNotSet)

STRING szDBUserName;

STRING szSQLDB;

STRING szSQLAddr;

STRING szSQLDSN;

begin

 

if(bAllowNotSet) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 1);

return 1;

endif;

 

if((CtrlGetState(DSN_SQLSERVER_DLG, IDC_RADIO_DSN_USER) = BUTTON_UNCHECKED) &&

(CtrlGetState(DSN_SQLSERVER_DLG, IDC_RADIO_DSN_SYSTEM) = BUTTON_UNCHECKED)) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

return 0;

endif;

CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_USER_NAME, szDBUserName);

if(StrLength(szDBUserName) = 0) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

return 0;

endif;

CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DSN, szSQLDSN);

if(StrLength(szSQLDSN) = 0) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

return 0;

else

if(!SQLValidDSN(szSQLDSN)) then

MessageBox("输入了无效的数据源名称!", INFORMATION);

_WinSubFocusControl(hwndDlg, IDC_EDIT_SQLSERVER_DSN);

return 0;

endif;

endif;

CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DB, szSQLDB);

if(StrLength(szSQLDB) = 0) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

return 0;

endif;

CtrlGetText(DSN_SQLSERVER_DLG, IDC_EDIT_DB_ADDR, szSQLAddr);

if(StrLength(szSQLAddr) = 0) then

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 0);

return 0;

endif;

 

_WinSubEnableControl(hwndDlg, SD_PBUT_CONTINUE, 1);

return 1;

end;

 

#endif // __KDCIS_RUL_

 

 

本文地址:http://www.45fan.com/dnjc/71281.html
Tags: 浅谈 InstallShield
编辑:路饭网
关于我们 | 联系我们 | 友情链接 | 网站地图 | Sitemap | App | 返回顶部