- NSIS Discussion
- [Search] unknown system call
Archive: [Search] unknown system call
Brummelchen
1st May 2004 19:15 UTC
[Search] unknown system call
we have a little problem...
anyony knows tweaking tools like TuneUp or TweakUI
now we have this entry
REGEDIT4
[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="8"
(this speeds up the menu open)
it is very simple to write a script for it, but unfortunately system does not take this value - only after restart.
but tweaking tools do so w/o system restart
so i suppose an unknown system call to establish those values
pls help
kichik
1st May 2004 20:54 UTC
You probably need to send WM_WININICHANGE. Try:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Control Panel"
/TIMEOUT=5000
Yathosho
1st May 2004 20:59 UTC
sorry for bringing up confusion in my previous post. it should work when you use
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:MenuShowDelay" /TIMEOUT=500
Brummelchen
2nd May 2004 06:19 UTC
nothing :/
;--------------------------------
;Configuration
!define PRODUCT "MenuShowDelay"
!define VERSION "1.0"
Name "'${PRODUCT}'"
Caption "MenuShowDelay 1.0"
OutFile "MenuShowDelay.exe"
!include WinMessages.nsh
;--------------------------------
;Installer Sections
Section ""
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
ReadINIStr $R0 "$EXEDIR\MenuShowDelay.ini" MenuShowDelay MenuShowDelay
WriteRegStr HKCU "Control Panel\Desktop" "MenuShowDelay" $R0
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:MenuShowDelay" /TIMEOUT=500
Quit
FunctionEnd
Yathosho
2nd May 2004 11:29 UTC
i'm sorry. by trying to take back the confusion of my previous post, i created some more confusion. doesn't work indeed :(
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) (LPCTSTR)"MenuShowDelay");
this is what i got from MSDN, but WM_SETTINGCHANGE is not supported by NSIS
Brummelchen
2nd May 2004 14:01 UTC
never mind, was just a try.
the damned nview desktop manager resets on startup the delay to 400 and i tried to help my friend...
thx 4all
Yathosho
3rd May 2004 16:58 UTC
still i'd love to see a solution :)
Joost Verburg
3rd May 2004 17:38 UTC
WM_SETTINGCHANGE is identical to WM_WININICHANGE.
Brummelchen
3rd May 2004 19:14 UTC
>> 1 warning:
>>unknown variable/constant "{WM_SETTINGCHANGE}" detected, ignoring
:cry:
Joost Verburg
3rd May 2004 19:32 UTC
As I already said, WM_WININICHANGE is the same. But I've added WM_SETTINGCHANGE so you can also use the modern name.
Yathosho
4th May 2004 16:40 UTC
guess that's why it still doesn't work ;)
Yathosho
8th May 2004 01:21 UTC
would it be possible to do the same by commandline (rundll or anything like that)? does anybody know about such stuff?
iceman_k
8th June 2004 16:29 UTC
Try this:
!define PRODUCT "MenuShowDelay"
!define VERSION "1.0"
Name "'${PRODUCT}'"
Caption "MenuShowDelay 1.0"
OutFile "MenuShowDelay.exe"
!include WinMessages.nsh
!define SPI_SETMENUSHOWDELAY 107
!define SPIF_SENDINICHANGE 3
;--------------------------------
;Installer Sections
Section ""
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
Push $R0
Push $R1
ReadINIStr $R0 "$EXEDIR\MenuShowDelay.ini" MenuShowDelay MenuShowDelay
System::call "user32::SystemParametersInfo(i ${SPI_SETMENUSHOWDELAY}, i R0 , i 0, i ${SPIF_SENDINICHANGE}) i .R1"
MessageBox MB_OK "Done: $R1"
Pop $R1
Pop $R0
Quit
FunctionEnd
Yathosho
13th June 2004 04:12 UTC
not sure if it's coincidence or if my system went unusuable after trying this. however, i can't tell what made my system unusable and i don't want to claim it was was the script's fault. in any case, i'm now using vmware to test scripts with code i don't understand. :p
i'd like to know more about this system call. what is SPI_SETMENUSHOWDELAY? is this meant to refresh the MenuDelay setting only? i'd be interested in finding out more about this, since i want to reload other settings from the registry aswell.
iceman_k
13th June 2004 15:37 UTC
Its a documented Windows API call- I don't see why it would mess up your system. Look up MSDN documentation on SystemParametersInfo. It is the same call made by TweakUI.
SPI_SETMENUSHOWDELAY is only for MenuDelay. There are a bunch of other settings, they're all in the API documentation.
Yathosho
13th June 2004 16:54 UTC
thanks for the reference, will look myself into it.
must've been coincidence, didn't mean to offend you.
thanks iceman_k!
iceman_k
13th June 2004 17:00 UTC
No offence taken. :)
Yathosho
22nd July 2004 23:35 UTC
i compiled and ran the script again, my system got kinda unusable.
whenever i right-click a file, submenus like "Send to.." or "Open with.." take several seconds until they are getting displayed.
next time i ran RegMon to see what the script does. i thought it just reads a setting (MenuDelay in this case) from the registry and applies it (otherwise one has to reboot to apply the setting). actually MenuShowDelay gets set to "0" (default is "400"). when i set this back to 400 and applied the setting, the menu still take several seconds until they appear.
this also brings up the question, what these variables are used for, since the "0" is the value, to which the menudelay is getting set.
any clue how i can reset all the settings made by this script?
Yathosho
23rd July 2004 03:03 UTC
hm, i reinstalled directx and now the problem is fixed.. how weird is that
iceman_k
23rd July 2004 03:30 UTC
The script is not reading the default value from the registry.
It expects you to have a file called MenuShowDelay.ini in the same directory as the MenuShowDelay.exe executable, with a section called MenuShowDelay and a value called MenuShowDelay.
I just tested the script on 3 different machines, two running Win XP Pro and one running Win 2K Pro. It ran fine on all three.
I don't know why directx would be an issue at all. SystemParametersInfo is a standard Windows API. SPI_MENUSHOWDELAY is supported on all versions except Windows 95.
Yathosho
24th July 2004 02:11 UTC
well, i know it sounds odd, but what can i say. it happened before and i was unsure, this time i could be sure. didn't happen on xp, but on a 2003 server, though it has the same registry entries. however, i'm glad i could solve this.
Yathosho
18th March 2005 11:36 UTC
Originally posted by iceman_k
Its a documented Windows API call- I don't see why it would mess up your system. Look up MSDN documentation on SystemParametersInfo. It is the same call made by TweakUI.
just to clear this up:
There is a bug in Windows Server 2003 that will cause short bursts of unresponsiveness when loading a sub menu such as SendTo. The cause of this problem is when the MenuShowDelay is set to "0" (which allows sub menus to instantly appear). This tweak is applied by either TweakUI, X-Setup, or by editing the Registry.
i found this on
msfn.org
iceman_k
18th March 2005 13:41 UTC
OK, so if the MenuShowDelay.ini file is missing, then the $R0 value is probably being set to 0 by default, hence the MenuShowDelay is also being set to 0- which triggers this bug.
The fix would be to modify the script to check that the value is > 0.
!define PRODUCT "MenuShowDelay"
!define VERSION "1.0"
Name "'${PRODUCT}'"
Caption "MenuShowDelay 1.0"
OutFile "MenuShowDelay.exe"
!include WinMessages.nsh
!define SPI_SETMENUSHOWDELAY 107
!define SPIF_SENDINICHANGE 3
;--------------------------------
;Installer Sections
Section ""
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
Push $R0
Push $R1
ReadINIStr $R0 "$EXEDIR\MenuShowDelay.ini" MenuShowDelay MenuShowDelay
IntCmp $R0 0 done done 0
System::call "user32::SystemParametersInfo(i ${SPI_SETMENUSHOWDELAY}, i R0 , i 0, i ${SPIF_SENDINICHANGE}) i .R1"
MessageBox MB_OK "Done: $R1"
done:
Pop $R1
Pop $R0
Quit
FunctionEnd
Brummelchen
18th March 2005 16:34 UTC
wow, after a year passed by this thread is still alive :)
meanwhile i dropped my investigations this way cause nvidia may solved this annoying bug. one of the latest drivers (66.xx).
"menushowdelay" is 8 here, 0 is too fast and default 400 is lame ;p