从Delphi(Win32)设置环境变量 [英] Set environment variables from Delphi (Win32)
问题描述
PS。我试图在控制台应用程序中执行此操作。
在Embarcadero开发人员网络中还有一个涵盖此问题的主题并提供用于发送消息的示例代码。作者使用 SendMessageTimeout 根据 WM_SETTINGCHANGE的MSDN文档中的建议 :
http://edn.embarcadero.com/article/28254
I'm trying to set a system wide environment variable from within my delphi application. The Documentation says to add a registry key to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and then broadcast a WM_SETTINGCHANGE message. Anyone know how to Broadcast this message?
PS. I'm trying to do this in a console application.
There is also a topic in the Embarcadero Developer Network covering this issue and providing sample code for sending the message. The author uses SendMessageTimeout as recommended in the MSDN doc for WM_SETTINGCHANGE:
http://edn.embarcadero.com/article/28254
这篇关于从Delphi(Win32)设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!