forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Refreshing Windows Question

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Sun Feb 06, 2005 9:03 pm    Post subject: Refreshing Windows Question Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 08, 2005 7:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Tue Feb 08, 2005 1:25 pm    Post subject: Reply with quote

Hehe..

I mean Windows OS Very Happy

But i did try it Smile

Im looking for the same effect as Windows "Display Properties" does when you
hit Apply.

_________________
Visual Dialogscript 5
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Tue Feb 08, 2005 3:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Tue Feb 08, 2005 4:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Tue Feb 08, 2005 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Feb 08, 2005 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 08, 2005 10:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Thu Feb 10, 2005 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 10, 2005 7:30 pm    Post subject: Reply with quote

Change the @win() function into @winexists()... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Thu Feb 10, 2005 9:23 pm    Post subject: Reply with quote

Still the same.. works but doens't update anything

I am on XP if that make any difference.

_________________
Visual Dialogscript 5
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Feb 11, 2005 12:27 am    Post subject: Reply with quote

did you include
Code:
#define function, sendmsg, win
in your code?

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Fri Feb 11, 2005 3:26 am    Post subject: Reply with quote

i do now Smile 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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Feb 11, 2005 3:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri Nov 27, 2009 2:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group