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)
|