This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Solution!
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 21, 2011
05:00 AM
SendMessageTimeout not working
Good day all,
I have a problem, but I am not sure exactly when it started to manifest.
For years our installer made environment variables by creating the keys and then calling SendMessageTimeout(...), and it worked fine.
However, I discovered today that the SendMessageTimeout call seems to either (a) fail silently or (b) not have an effect.
Here is what I have:
The problem is that after the install finishes the environment is not updated, and a reboot is not triggered :confused:
Any ideas?
I have a problem, but I am not sure exactly when it started to manifest.
For years our installer made environment variables by creating the keys and then calling SendMessageTimeout(...), and it worked fine.
However, I discovered today that the SendMessageTimeout call seems to either (a) fail silently or (b) not have an effect.
Here is what I have:
#define WM_SETTINGCHANGE 0x001A
#define HWND_BROADCAST 0xffff
#define SMTO_ABORTIFHUNG 0x0002
prototype BOOL USER.SendMessageTimeout(HWND, INT, INT, POINTER, INT, INT, POINTER);
function RefreshEnvironment()
STRING sParam;
POINTER pParam, pResult;
LONG lResult;
begin
sParam = "Environment";
pParam = &sParam;
pResult = &lResult;
if (!SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, pParam, SMTO_ABORTIFHUNG, 500, pResult))
then
BATCH_INSTALL = TRUE;
endif;
end;
The problem is that after the install finishes the environment is not updated, and a reboot is not triggered :confused:
Any ideas?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 21, 2011
06:18 AM
Solved it now by using SendMessageTimeoutA. I guess IS was calling the Unicode version, and I suspect my string parameter was not correct.
The other option (need to verify) is to declare sParam as WSTRING.
The other option (need to verify) is to declare sParam as WSTRING.