Jump to content
Sign in to follow this  
Dalex

windows combobox

Recommended Posts

I'm a N00B I and I just cant figure somethig out, I want to build a script that will set Windows XP Desktop theme to "windows classic" so far my script will open the display properties and open the dropdown ComboBox

but I can't get it to select "Windows Classic". I want it to select Windows Classic specifically.

Thanks for any help I know this is simple question , but I am stumped. :o


[size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]

Share this post


Link to post
Share on other sites

I'm a N00B I and I just cant figure somethig out, I want to build a script that will set Windows XP Desktop theme to "windows classic" so far my script will open the display properties and open the dropdown ComboBox

but I can't get it to select "Windows Classic". I want it to select Windows Classic specifically.

Thanks for any help I know this is simple question , but I am stumped. :o

Can you please show us what you have tried so far.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I'm a N00B I and I just cant figure somethig out, I want to build a script that will set Windows XP Desktop theme to "windows classic" so far my script will open the display properties and open the dropdown ComboBox

but I can't get it to select "Windows Classic". I want it to select Windows Classic specifically.

Thanks for any help I know this is simple question , but I am stumped. :o

Welcome to the AutoIt Forums... Dalex

here is a starting point for you...

Local $RUNDLL32 = @SystemDir & "\rundll32.exe"
Run($RUNDLL32 & " shell32.dll,Control_RunDLL desk.cpl")

While WinActivate("Display Properties", "Screen Saver") <> 1
    ControlSend("Display Properties", "", "SysTabControl321", "{RIGHT}")
    Sleep(200)
WEnd

WinActivate("Display Properties", "Screen Saver")
WinWait("Display Properties", "Screen Saver")
Sleep (1000)

ControlSetText("Display Properties", "Screen Saver", 1306, "20")

Sleep (1000)

While WinActivate("Display Properties", "Settings") <> 1
    ControlSend("Display Properties", "", "SysTabControl321", "{RIGHT}")
    Sleep(200)
WEnd

you will need to learn about ControlCommand() in help

a great place to really start is

"Welcome to AutoIt 1-2-3"... it is in my sgnature below

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

That's funny, I decided to play with it too... here's another look:

ChangeToClassic()
Func ChangeToClassic()
    $opt = Opt('WinTitleMatchMode', 4)
    Run('rundll32.exe shell32.dll,Control_RunDLL desk.cpl')
    WinWait('Display Properties')
    ControlCommand('Display Properties', '', 'ComboBox1', 'SelectString', 'Windows Classic')
    ControlClick('Display Properties', '&Apply', 'Button5')
    Do
        Sleep(10)
    Until Not WinExists('classname=CoverWindowClass')
    ControlClick('Display Properties', 'OK', 'Button3')
    Opt('WinTitleMatchMode', $opt)
EndFunc

Edit:

Added WinWait() instead of Sleep()

Edited by SmOke_N

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.

Share this post


Link to post
Share on other sites

Here is my pathetic attempt

#include <Process.au3>
Opt("WinTitleMatchMode", 4)
_RunDOS("start c:\windows\system32\desk.cpl")
WinWait("Display Properties","A theme is a background plus a")
ControlCommand("Display Properties","A theme is a background plus a","ComboBox1","SelectString",'Windows Classic')
ControlClick("Display Properties","A theme is a background plus a","Button3")


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Here is my pathetic attempt

#include <Process.au3>
Opt("WinTitleMatchMode", 4)
_RunDOS("start c:\windows\system32\desk.cpl")
WinWait("Display Properties","A theme is a background plus a")
ControlCommand("Display Properties","A theme is a background plus a","ComboBox1","SelectString",'Windows Classic')
ControlClick("Display Properties","A theme is a background plus a","Button3")

Wow that is very elaborate here is what I was using to get the window open drop the box.

thanks Smoke_n that one worked

send("#r")

Send ("desk.cpl")

Send("{ENTER}")

WinWaitActive("Display Properties")

ControlCommand("Display Properties", "", "ComboBox1", "ShowDropDown", "")

Edited by Dalex

[size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]

Share this post


Link to post
Share on other sites

Wow that is very elaborate here is what I was using to get the window open drop the box.

thanks Smoke_n that one worked

send("#r")

Send ("desk.cpl")

Send("{ENTER}")

WinWaitActive("Display Properties")

ControlCommand("Display Properties", "", "ComboBox1", "ShowDropDown", "")

yours too Big Dod

thanks looks like I have a lot more reading to do!


[size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...