![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-08 02:20 |
48,041 topics / 350,128 posts / today 3 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » [Sharing] Experiencing the cmd window in Notepad |
| Printable Version 1,046 / 10 |
| Floor1 plp626 | Posted 2008-04-07 21:15 |
| 银牌会员 Posts 1,020 Credits 2,278 | |
|
On a blank area of the desktop, right-click Properties --- Appearance --- Advanced --- Item (I) -- select Window from the drop-down menu:
Color (L), select black from the drop-down menu (I recommend green (80 240 88), it's easier on the eyes) Color (R), select white from the drop-down menu Then confirm, Apply, OK! Actually I'm here to ask a question: I want to use sendkey to do this, but I can't use the traditional method to select the color drop-down menu. Just run this directly: ------------------------------------------------------- Best answer: see post #10 (answered by zh159, slore, thanks here) [ Last edited by plp626 on 2008-4-8 at 02:18 PM ] |
|
| Floor2 zh159 | Posted 2008-04-07 21:45 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
I only know that sending the space key here can open the color drop-down menu
|
|
| Floor3 slore | Posted 2008-04-07 21:51 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
wscript.sleep 2000
Set WSHell = WScript.CreateObject("WScript.Shell") WSHell.SendKeys "{tab 4}" WSHell.SendKeys "{d}" WSHell.SendKeys "{left 15}" WScript.CreateObject("WScript.Shell").SendKeys "{tab}" wscript.sleep 1500 MsgBox "Could some expert please point this out: how do I send the color drop-down menu? Thanks!" 'WSHell.SendKeys "{l}" I suggest doing it this way... to avoid too many . operations. Because that one responds to the mouse... it has nothing to do with key presses, so sendkeys is ineffective. Two optional methods: 1. Move to Custom, then use sendkeys to select the color you want (key response works here). 2. Modify the registry directly... I recommend the second method, it's accurate. PS: sendkeys isn't very reliable, you'd better add delays in the middle of the sendkeys too... you should add a delay before your left, otherwise sometimes it doesn't execute at all. |
|
| Floor4 plp626 | Posted 2008-04-07 23:05 |
| 银牌会员 Posts 1,020 Credits 2,278 | |
|
So space works after all. zh159, you really know a lot. I used shift+...., alt+..., tried N+N buttons, and how come I never tried space,
------------------------------ I know you're great at VBS, slore, but I don't understand the second method of modifying the registry. |
|
| Floor5 plp626 | Posted 2008-04-07 23:38 |
| 银牌会员 Posts 1,020 Credits 2,278 | |
|
zh159, slore, a new question: how do I confirm it?
[ Last edited by plp626 on 2008-4-8 at 12:04 AM ] |
|
| Floor6 slore | Posted 2008-04-08 02:49 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
@echo off
<%0 more +6>col.vbs start control desk.cpl,,2 start col.vbs exit wscript.sleep 1500 Set WSHell = WScript.CreateObject("WScript.Shell") WSHell.SendKeys "%D" wscript.sleep 1000 WSHell.SendKeys "{left 15}" WSHell.SendKeys "%L" WSHell.SendKeys " " 'wscript.sleep 500 WSHell.SendKeys "%O" WSHell.SendKeys "{left 7}" WSHell.SendKeys " " WSHell.SendKeys "{Enter}" WSHell.SendKeys "%R" WSHell.SendKeys " " 'wscript.sleep 500 WSHell.SendKeys "%O" WSHell.SendKeys "{right 7}" WSHell.SendKeys " " WSHell.SendKeys "{Enter}" 'WSHell.SendKeys "160" 'WSHell.SendKeys "{tab}" 'WSHell.SendKeys "0" 'WSHell.SendKeys "{tab}" 'WSHell.SendKeys "0" 'wscript.sleep 1500 'If you use custom colors, you already know how to fill them in, right? 'Send Alt+A to add it to Custom, then Tab to select it, same thing, use space to confirm. Set WSHell = Nothing |
|
| Floor7 xb2008chopin | Posted 2008-04-08 02:52 |
| 初级用户 Posts 11 Credits 24 | |
|
Supporting the OP a bit, I get it now!
|
|
| Floor8 slore | Posted 2008-04-08 02:59 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
Originally posted by plp626 at 2008-4-7 23:05: Too lazy to look closely... just download regshot or some other registry comparison software and see for yourself the changed values before and after the modification. I don't know whether the registry refresh is simple or not... changing this place seems to take effect after a right-click refresh... Anyway, logging off and rebooting definitely make it take effect, heh. |
|
| Floor9 zh159 | Posted 2008-04-08 10:59 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
Confirming it is very simple, just send an Enter key, because in most system settings interfaces, pressing Enter will by default click the "OK" button
|
|
| Floor10 plp626 | Posted 2008-04-08 14:16 |
| 银牌会员 Posts 1,020 Credits 2,278 | |
|
The colors below are very soft, everyone can give them a try.
Whoever understands VBS better, if possible, please simplify the code a bit with a for loop: |
|
| Floor11 slore | Posted 2008-04-08 20:36 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
start rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2
WSHell.SendKeys "{tab 4}" WSHell.SendKeys "{d}" Take a look at how I wrote these two lines~ learn to use access keys... As for simplifying it with a loop, that would just make it look a bit nicer... the pattern here isn't very strong, and you'd still need to use an array to store each step... troublesome |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |