您现在的位置:软界网技术中心软件开发PowerBuilder > 技术显示
在应用程序中启动控制面板,不用API,直接在PB中调用
2005-3-13 0:00:00   网友评论       阅读次数 点此评论
   API应用

在PowerBuilder中调用ChooseColor函数

获得应用程序所在目录

在应用程序中启动控制面板,只需用ShellExecute函数打开对应的CPL文件即可,例如要在应用程序中修改Windows密码,只需打开Password.cpl文件,启动ODBC管理器只要打开ODBCCP32.CPL。

函数声明:
Function Long ShellExecute(Long hwindow, String lpOperation, String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library 'shell32.dll' Alias for ShellExecuteA
Function Long GetDesktopWindow() Library 'user32.dll'

脚本如下:
String ls_cpl_name
String ls_null

SetNull(ls_null)
ls_cpl_name = "Password.cpl"

ShellExecute(GetDesktopWindow(), ls_null, 'rundll32.exe', "shell32.dll,Control_RunDLL " + ls_cpl_name + ",", ls_null, 0)

 
      来源: 作者:
 
【评论查看】