VB6应用程序不接受RegKey更新 [英] VB6 Application does not pick up RegKey update

查看:63
本文介绍了VB6应用程序不接受RegKey更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我写了一个C#应用程序工具,将CurrentUser的sShortDate RegKey条目(Control Panel\International)更改为另一个VB6应用程序使用的格式。



该工具适用于Win7,VB6应用程序使用新的RegKey。



问题进入当我在Win-XP上使用工具时播放,然后VB6应用程序忽略更改并使用sShortDate的旧RegKey条目。



转到控制面板时>区域设置只是重新应用工具已经设置的sShortDate格式,然后VB6应用程序使用它...



为什么RegKey更新在Win7上为所有应用程序工作但不在Win-XP上工作?

(我正在调用user32.dll-SendMessageTimeoutA让应用程序知道更改)



下面的代码示例:

Hi,
I wrote a C# Application "Tool" to change the sShortDate RegKey entry("Control Panel\International") for the CurrentUser to a format which is used by another VB6 Application.

The Tool works on Win7 and the VB6 Application uses the new RegKey.

The problem comes into play when I use the Tool on Win-XP, then the VB6 Application ignores the change and uses the "old" RegKey entry for sShortDate.

When going to Control Panel > Regional Settings and just "re-applying" the sShortDate format which the Tool already set it to, then the VB6 Application uses it...

Why does the RegKey update work on Win7 for all applications started but not on Win-XP?
(I''m calling the user32.dll-SendMessageTimeoutA to let the applications know of the change)

Code Sample below:

//Registry Logic
//Open Sub key
Microsoft.Win32.RegistryKey rkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Control Panel\International", true);
if (rkey != null)
{
 rkey.SetValue("sShortDate", dateFormat);
 //Close the Registry
 rkey.Close();
}
int dwError = 0;
SendMessageTimeoutA(m_hWnd, m_msg, 0, "International", SMTO_BLOCK, 10000, dwError);





任何想法为什么VB6应用程序没有为sShortDate获取新的RegKey入口值会有很大的帮助。



亲切的问候,

TiCKoMasta



Any idea why the VB6 Application is not taking the new RegKey entry value for the sShortDate would be of great help.

Kind regards,
TiCKoMasta

推荐答案

发现发生了什么。



出于某种原因,你需要在Win-XP中设置一个额外的RegKey:



iDate



此RegKey似乎与用于在Win-XP上处理VB6中的DateFormating的sShortDate条目。



奇怪的是,在Win7中使用相同的VB6应用程序时不必设置它,所以我的猜测是Windows7有一个内部API方法,与Win-XP中使用的方法不同。



感谢你的回复,希望这个解决方案可以帮助一些孤独的VB6编码器。 :P $ / $


亲切的问候,

TiCKoMasta
Hi, found out what was going on.

For some reason you need to set an additional RegKey in Win-XP:

iDate

This RegKey seems to be combined with the sShortDate entry to handle DateFormating in VB6 on Win-XP.

The strange thing is is that it does not have to be set when using the same VB6 Application in Win7, so my guess is that the Windows7 has a internal API method that is different to the one used in Win-XP.

Thanks for the reply tho, hope this solution helps some lonely VB6 coder somewhere. :P

Kind regards,
TiCKoMasta


这篇关于VB6应用程序不接受RegKey更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆