Script Center >
Scripting Forums
>
The Official Scripting Guys Forum!
>
VBScript to Change Windows System colors
VBScript to Change Windows System colors
- I have a script which changes drive mappings. This allows me to test database design changes without messing up real data. I would like to incorporate into the script something to change the windows title bar color to provide me with a visual cue as to the fact that I am not currently mapped to the network drives. I can't seem to fugure out how to change system colors via a script. Any ideas?
All Replies
- Each form used by each application can have it's own title, so we need to know the application. Assuming VBScript and the MsgBox function, you can specify a title, but not colors. However, you can specify an icon. For example, if the drive is mapped you could use the exclamation icon in a message box:
Call MsgBox("This is the message, which can be several lines", vbOKOnly + vbExclamation, "Title of Application")
But if the drive is not mapped you could use the information icon in the message box:
Call MsgBox("This is the message, which can be several lines", vbOKOnly + vbInformation, "Title of Application")
The icon could serve to flag which condition you have. Otherwise, we need information on what application title you are dealing with.
Richard Mueller
MVP ADSI - Richard,
Thanks for the response. I was hoping to change the color of the title bars on any application that's open (or will be open). Alternatively, if there's anything else I can do easily in a script to create a visual cue that I have run the drive mapping script, and am therefore not connecting to the server drives normally, that would be great. The msgbox may be adequate though. I just need a reminder, because, sometimes I forget where I'm at (or what I'm doing)!
Thanks,
Keith Each application would need to expose a public function that allowed you to change the color (or some attribute) of the title bar. I don't know of any applications that do that.
Your script that does the drive mappings could do something else. Maybe create a shortcut or file on the desktop. The name of the file could indicate that the mappings were done. However, I don't know how the file would be deleted when the mappings are removed, unless this is done in the script as well.
Richard Mueller
MVP ADSI

