Sign in to follow this  
Followers 0
dufran3

Setting Changes

18 posts in this topic

Ok, I know that I have asked a lot of questions here in this forum, but I feel that I have learned a lot by your responses. Here is what I am trying to do. There are several settings that I am trying to change on pc's but am having a hard time finding a good way to do it. For Example, one of the settings I am changing, is I am adding a proxy server and address and changing the homepage. I was able to do that by editing simple registy keys. However, there are some other settings that I am trying to change, that I can't figure out how to change them in a good way. Right now, I am manually having to open up each window, which causes lots of problems. Here are 2 of the things I am trying to change, there are some more, if anyone wants to help me tackle a few others besides these, I would really appreciate it. I am hoping that if someone figures out a better way to do these 2, I could figure out the rest based on that. Anyway, here is what I am trying to do. Change the Star Menu to the "classic" style. Change the Computer theme to "Classic"( this is in display properties). I am also removing some icons from the desktop. Anyway, here is what I am currently using, it is definitely not the best way to do this. PLEASE HELP!!! Oh YEh, YOU GUYS ROCK!!!

;This Script requires the Control Panel view to be set at the Category view. It changes it to the classic view, ;however it requires it to be Category or the script won't run. This is one of the biggest problems in doing it ;this way!!!

Func ClassicStart()
    ;Open Run
    Send("#r")

    ;Run Window
    WinWaitActive("Run")
    Send("control")
    Send("{ENTER}")

    ;Control Panel
    WinWaitActive("Control Panel","Control Panel")
    Send("{TAB 2}")
    Send("{SPACE}")
    Sleep(1000)
    Send("task")
    Send("{ENTER}")

    ;Taskbar properties
    WinWaitActive("Taskbar and Start Menu Properties","Taskbar")
    Send("{TAB 10}")
    Send("{RIGHT}")
    Send("{TAB}")
    Sleep(1000)
    Send("{DOWN}")
    Send("{ENTER}")

    ;Control Panel
    WinWaitActive("Control Panel","Control Panel")
    Send("!")
    Send("f")
    Send("c")
    WinWaitClose("Control Panel","Control Panel")
    
    ;Log Setting Change
    LogSettingChangeSuccess("Classic Start Menu")
EndFunc
oÝ÷ Øw«z+-í§vÞjëh×6
Func ClassicTheme()
    ;Open Run Dialog
    Send("#r")

    ;Run Window
    WinWaitActive("Run")
    Send("C:\Windows\Resources\Themes\Windows Classic.theme")
    Send("{ENTER}")

    ;Display Properties
    WinWaitActive("Display Properties")
    Send("{TAB 5}")
    Send("{RIGHT}")
    Send("!d")

    ;Desktop Items
    WinWaitActive("Desktop Items")
    Send("{SPACE}")
    Send("!u")
    Send("{TAB 2}")
    Send("{SPACE}")

    ;Display Properties
    WinWaitActive("Display Properties")
    Send("!a")
    Sleep(5000)
    Send("{TAB 5}")
    Send("{SPACE}")
    WinWaitClose("Display Properties")
    
    ;Log Setting Change
    LogSettingChangeSuccess("Classic Theme")
EndFunc

THANKS!!!!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Func ClassicTheme()
    ;Open Run Dialog
    Send("#r")

    ;Run Window
    WinWaitActive("Run")
    Send("C:\Windows\Resources\Themes\Windows Classic.theme")
    Send("{ENTER}")

    ;Display Properties
    WinWaitActive("Display Properties")
    Send("{TAB 5}")
    Send("{RIGHT}")
    Send("!d")

    ;Desktop Items
    WinWaitActive("Desktop Items")
    Send("{SPACE}")
    Send("!u")
    Send("{TAB 2}")
    Send("{SPACE}")

    ;Display Properties
    WinWaitActive("Display Properties")
    Send("!a")
    Sleep(5000)
    Send("{TAB 5}")
    Send("{SPACE}")
    WinWaitClose("Display Properties")
    
    ;Log Setting Change
    LogSettingChangeSuccess("Classic Theme")
EndFunc
oÝ÷ Ûú®¢×¢»ajÚ'{*.¶¬ªê-(!¶«¨·
+«­¢+Ø)}5½¥åQ¡µ Ìäí]¥¹½ÝÌ
±ÍÍ¥Ìäì¤()Õ¹}5½¥åQ¡µ ÀÌØíÍQ¡µ¤(%IÕ¸ ÌäíÉÕ¹±°ÌȹáÍ¡±°Ìȹ±°±
½¹Ñɽ±}IÕ¹10ͬ¹Á°°°ÔÌäì¤(%]¥¹]¥Ð Ìäí¥ÍÁ±äAɽÁÉÑ¥ÌÌäì¤(%
½¹Ñɽ±
½µµ¹ Ìäí¥ÍÁ±äAɽÁÉÑ¥ÌÌäì°ÌäìÌäì°Ìäí
½µ½  ½àÄÌäì°ÌäíM±ÑMÑÉ¥¹Ìäì°ÀÌØíÍQ¡µ¤(%
½¹Ñɽ±
±¥¬ Ìäí¥ÍÁ±äAɽÁÉÑ¥ÌÌäì°ÌäìÌäì°Ìäí  ÕÑѽ¸ÔÌäì¤($ÀÌØí=ÁÑ]Q54ô=ÁÐ Ìäí]¥¹Q¥Ñ±5Ñ¡5½Ìäì°Ð¤(%]¥¹]¥Ð Ìäí±Í͹µõ
½ÙÉ]¥¹½Ý
±ÍÌÌäì¤(%]¥¹]¥Ñ
±½Í Ìäí±Í͹´õ
½ÙÉ]¥¹½Ý
±ÍÌÌäì¤(%=ÁÐ Ìäí]¥¹Q¥Ñ±5Ñ¡5½Ìäì°ÀÌØí=ÁÑ]Q54¤(%
½¹Ñɽ±
±¥¬ Ìäí¥ÍÁ±äAɽÁÉÑ¥ÌÌäì°Ìäí=,Ìäì°Ìäí    ÕÑѽ¸ÌÌäì¤)¹Õ¹

If it does, it will give you an idea on what to do for the other.

Edit:

The example before didn't work, this one is tested though.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

How did you find that .cpl file?

Share this post


Link to post
Share on other sites

How did you find that .cpl file?

Googled

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Ok, I looked at the code and I understand most of it, one thing I don't understand however, is how to switch between tabs. I used the AutoIt Window tool, to try and find the control ID, as it looks like that is what you were doing. However it doesn't appear that each tab has a different control ID.

Share this post


Link to post
Share on other sites

Run('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,5') << 5 is the Themes tab.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

yay!! I found this

Display Options (DESK.CPL)

-------------------------------

Display Properties (Background):

rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0

Display Properties (Screen Saver):

rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1

Display Properties (Appearance):

rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2

Display Properties (Settings):

rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3

Share this post


Link to post
Share on other sites

lol, thx though man!

Share this post


Link to post
Share on other sites

I'm trying to duplicate this and use elsewhere as it is fantastic...however...I cannot find any documentation on the lines with the arrows next to them....any info would be friggin great

_ModifyTheme('Windows Classic')

Func _ModifyTheme($sTheme)
    Run('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,5')
    WinWait('Display Properties')
    ControlCommand('Display Properties', '', 'ComboBox1', 'SelectString', $sTheme)
    ControlClick('Display Properties', '', 'Button5')
    $OptWTMM = Opt('WinTitleMatchMode', 4)  ;<========Not sure what function "Opt" is all about
    WinWait('classname=CoverWindowClass') ;<======== not sure what clasname=CoverWindowClass is
    WinWaitClose('classnam=CoverWindowClass')  ;<======^^Same
    Opt('WinTitleMatchMode', $OptWTMM)       ;<=====?? Couldn't find anything on opt
    ControlClick('Display Properties', 'OK', 'Button3')
EndFunc

THX Again, as always... I'm trying my best to learn...:-(

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Lookup WinTitleMatchMode in the help file.

It will take you to a list of "Opt" settings.

WinTitleMatchMode "mode 4" lets the script use classnames for the title.

The Opt function "Returns the value of the previous setting for the option."

...so, $OptWTMM = Opt('WinTitleMatchMode', 4)

sets $OptWTMM to whatever mode you might have used elsewhere in your script.

...then, Opt('WinTitleMatchMode', $OptWTMM)

sets the WinTitleMatchMode mode back to whatever mode you might have used elsewhere in your script before leaving the function.

I'll have to let SmOke_N explain CoverWindowClass

Edit - also see "Window Titles and Text (Advanced)" in the help file.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I am such a freaking n00b

Share this post


Link to post
Share on other sites

I'll have to let SmOke_N explain CoverWindowClass

Edit - also see "Window Titles and Text (Advanced)" in the help file.

It's the Class of the window that pops up on XP Pro SP2 after I clicked apply.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

oh ic

Share this post


Link to post
Share on other sites

anyone have any ideas about the first one?

Share this post


Link to post
Share on other sites

One of the Auto3Lib test scripts (Taskbar.au3) shows how to set a computer up with the "Classic" view. It opens the Taskbar dialog and shows how to set various options, including how to navigate the tabs. Not sure if that is what you are looking for, but it may be worth giving a quick look just to get some ideas even if it's not.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

I found this command.

'RunDll32.exe shell32.dll,Options_RunDLL 1'

Yay for RunDll32.exe commands.

Another question off topic, where should I start to learn about Windows API and using COM Objects.

Edited by dufran3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0