Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Correct SendMessageTimeout param from VB6?

139 views
Skip to first unread message

codej...@my-deja.com

unread,
Jul 1, 1999, 3:00:00 AM7/1/99
to
Hi folks -

Haven't worked much with calling DLLs from VB6 so
I'm hoping someone can help with this problem:

I'm trying to set an environment variable in the
NT 4.0 registry and I want to refresh the
registry which, according to

http://support.microsoft.com/support/kb/articles/q
104/0/11.asp, is done like this:

SendMessageTimeout(HWND_BROADCAST,
WM_SETTINGCHANGE, 0, (LPARAM) "Environment",
SMTO_ABORTIFHUNG, 5000, &dwReturnValue);


I've included the following DLL declaration
together with the required constants in the VB
project:

Public Declare Function
SendMessageTimeout Lib "user32" Alias
"SendMessageTimeoutA" (ByVal hwnd As Long, ByVal
msg As Long, ByVal wParam As Long, ByVal lParam
As Long, ByVal fuFlags As Long, ByVal uTimeout As
Long, lpdwResult As Long) As Long


And I make the call like this:

Dim retval As Long

Call SendMessageTimeout(HWND_BROADCAST,
WM_SETTINGCHANGE, 0, ??????, SMTO_ABORTIFHUNG,
5000, retval)


As you can see from the ?????, I don't know how
to pass the "Environment" parameter - am I right
in thinking "Environment" is a constant, although
I can't find it in the API Viewer or elsewhere? I
can see the parameter should be a Long in VB, but
how can I find the value of "Environment" in
order to pass it? Anyone ever done this from VB?

Any advice greatfully recieved...

TIA,

Mark


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

0 new messages