| View previous topic :: View next topic |
| Author |
Message |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Sun Feb 06, 2005 9:03 pm Post subject: Refreshing Windows Question |
|
|
How do you refresh windows?
I am creating a display theme program that change all the system colors in the registry. but i do not know how to apply them without logging out.
Anyone know how to do this? _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 08, 2005 7:58 am Post subject: |
|
|
i'm guessing here - how about F5? i know that it i click on "nothing" on the desktop and press F5, then it refreshes the desktop
serge _________________
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Tue Feb 08, 2005 1:25 pm Post subject: |
|
|
Hehe..
I mean Windows OS
But i did try it
Im looking for the same effect as Windows "Display Properties" does when you
hit Apply. _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue Feb 08, 2005 3:01 pm Post subject: |
|
|
kOt,
That depends on what you are trying to refresh.... There are some drivers and services that are only loaded at startup.
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Feb 08, 2005 4:36 pm Post subject: |
|
|
You need VDS 5 to use the following code below. It uses the Windows API to refresh the desktop.
| Code: |
loadlib shell32.dll
%X = @lib(shell32, SHChangeNotify, INT:, $8000000, 0, 0, 0)
freelib shell32.dll
|
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Tue Feb 08, 2005 5:31 pm Post subject: |
|
|
HKEY_CURRENT_USER\Control Panel\Colors
is the keys in registry i am changing. which are the system color keys
I am looking for a way to refresh Windows (Operating System) to show the changes to the keys
The only way i have now is to logout and log back in. Which is a pain bc it takes way to long for such little changes _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Feb 08, 2005 5:38 pm Post subject: |
|
|
You could also try sending a WM_SYSCOLORCHANGE message: for details see PGWare's invaluable VDS API Reference, which you can presumably download from here somewhere. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 08, 2005 10:10 pm Post subject: |
|
|
this is what the api file says
| Quote: | WM_SYSCOLORCHANGE
Windows = (Windows NT, Windows 95, Windows 98, Win32's)
wParam = 0; // not used; must be zero
lParam = 0; // not used; must be zero
Message ID = $015
Description: The WM_SYSCOLORCHANGE message is sent to all top-level windows when a change is made to a system color setting.
Return Value: This message does not return a value.
Sample Source Code
title TEST
DIALOG CREATE,TEST,-1,0,215,84
DIALOG ADD,BUTTON,BUTTON1,38,66,,,,DEFAULT
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
%A = @sendmsg(@win(TEST),$015,0,0)
rem Sends Message to all windows informing color change
goto evloop
:CLOSE
exit
|
serge _________________
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Thu Feb 10, 2005 5:30 pm Post subject: |
|
|
This sound like just what i am wanting
i played around with the sample code and 1 line doesn't work
| Code: |
title TEST
DIALOG CREATE,TEST,-1,0,215,84
DIALOG ADD,BUTTON,BUTTON1,38,66,,,,DEFAULT
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
rem This line doesn't work
%A = @sendmsg(@win(TEST),$015,0,0)
rem Sends Message to all windows informing color change
goto evloop
:CLOSE
exit
|
I tried @window (doesn't work); @wintext (works but doesn't seem to update anything) ; just putting in the window name ( same as @wintext) _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Thu Feb 10, 2005 9:23 pm Post subject: |
|
|
Still the same.. works but doens't update anything
I am on XP if that make any difference. _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Feb 11, 2005 12:27 am Post subject: |
|
|
did you include | Code: | | #define function, sendmsg, win | in your code?
serge _________________
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Fri Feb 11, 2005 3:26 am Post subject: |
|
|
i do now but still nothing
i think i may just give up on this one
| Code: | #define function, sendmsg, win
title TEST
DIALOG CREATE,TEST,-1,0,215,84
DIALOG ADD,BUTTON,BUTTON1,38,66,,,,,DEFAULT
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
rem This line doesn't work
%A = @sendmsg(@winexists(TEST),$015,0,0)
rem Sends Message to all windows informing color change
goto evloop
:CLOSE
exit |
_________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Feb 11, 2005 3:53 am Post subject: |
|
|
| Win32 Programmer's Reference wrote: |
The WM_SYSCOLORCHANGE message is sent to all top-level windows when a change is made to a system color setting.
WM_SYSCOLORCHANGE
Parameters
This message has no parameters.
Remarks
Windows sends a WM_PAINT message to any window that is affected by a system color change.
Applications that have brushes using the existing system colors should delete those brushes and recreate them using the new system colors.
Top level windows that use common controls must forward the WM_SYSCOLORCHANGE message to the controls; otherwise, the controls will not be notified of the color change. This ensures that the colors used by your common controls are consistent with those used by other user interface objects. For example, a toolbar control uses the "3D Objects" color to draw its buttons. If the user changes the 3D Objects color but the WM_SYSCOLORCHANGE message is not forwarded to the toolbar, the toolbar buttons will remain in their original color while the color of other buttons in the system changes.
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Nov 27, 2009 2:48 am Post subject: |
|
|
I know this is seriously old post, but it's related to what I'm doing now.
PK's api call up there does work, it Windows does update all the windows, but the problem is, the changes made to the registry are not being applied at all.
Here's the code I tried
| Code: | title TEST
DIALOG CREATE,TEST,-1,0,215,84
DIALOG ADD,BUTTON,BUTTON1,38,66,,,,DEFAULT
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
REGISTRY WRITE,CURUSER,Control Panel\Colors,ButtonFace,"0 0 0"
rem %A = @sendmsg(@winexists(TEST),$015,0,0)
loadlib shell32.dll
%X = @lib(shell32, SHChangeNotify, INT:, $8000000, 0, 0, 0)
freelib shell32.dll
rem Sends Message to all windows informing color change
goto evloop
:CLOSE
exit |
The registry entry is changed, windows is refreshing, but it seems it's not getting it's data from that registry key.
I tried a few other locations where the same key is listed, but to no avail.
Any ideas?
Thanks,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|