[Windows Mobile Software Development] RoryB:
Radio toggle between Automatic (2G & 3G) and GSM (2G only)

This script calls the main script with the argument required based on your current profile to switch the profile to the other.

# Band_Toggle.mscr
opmode = RegRead( "HKLM","Software\OEM\UMTS","OpMode")
opmode = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName" & OpMode + 1)

If(opmode eq "Auto")
key = "g"
Else
key = "a"
EndIf
CallScript("\storage card\scripts\Band_Changer.mscr", key)
# CallScript("\windows\Band_Changer.mscr", key)

I test the script in my storage card, but when I use it for CHTS I would have it in \windows folder.

This is the main script:

# Band_Changer.mscr

If(NOT FileExists("\Windows\CMBandSwitching.exe"))
Message("You must have CMBandSwitching.exe installed in windows folder.^NL^^NL^Script will exit now.", "ERROR")
Exit
EndIf

key = argv[1]
key = (key eq "a")?"Auto":"GSM"
opmode = RegRead( "HKLM","Software\OEM\UMTS","OpMode")
opmode = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName" & OpMode + 1)
network1 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName1" )
network2 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName2" )
network3 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName3" )

If(key ne OpMode)
If(key eq network1)
key = 1
ElseIf(key eq network2)
key = 2
ElseIf(key eq network3)
key = 3
Else
EndIf
Call("switcher")
EndIf

Sub switcher
Global(key)

SendSpecial(126) # Data disconnect
i=0
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
i+=1
enable[i] = RegRead("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled")
EndForEach
Sleep(500)
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
RegWriteDWord("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled", 0)
EndForEach
Sleep(500)

Run("\Windows\CMBandSwitching.exe")
If(ScreenHeight() eq 640)
Y1 = 160 # 1st button which is Auto on my Fuze 163
Y2 = 245 # 2nd button which is GSM on my Fuze 244
Y3 = 315 # 3rd button which is WCDMA on my Fuze 314
Y4 = 610 # Done button on my Fuze 608
X4 = 135 # Done button on my Fuze 134
Y5 = 460 # Done button on my Fuze 460
X5 = 125 # Done button on my Fuze 125
ElseIf(ScreenHeight() eq 800)
Y1 = 150 # 1st button which is Auto on HD2 150
Y2 = 200 # 2nd button which is GSM on HD2 200
Y3 = 305 # 3rd button which is WCDMA on HD2 305
Y4 = 750 # Done button on HD2 750
X4 = 110 # Done button on HD2 110
Y5 = 480 # Done button on HD2 480
X5 = 110 # Done button on HD2 110
EndIf
While(NOT WndActive("Band"))
Sleep(50)
EndWhile
If(key eq 1)
MouseClick("Band", ScreenWidth()*0.25, Y1) # 1st button
ElseIf(key eq 2)
MouseClick("Band", ScreenWidth()*0.25, Y2) # 2nd button
Else
MouseClick("Band", ScreenWidth()*0.25, Y3) # 3rd button
EndIf
Sleep(150)
SendSpecial(112) # Done

Sleep(500)
i=0
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
i+=1
RegWriteDWord("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled", enable[i])
EndForEach

Sleep(20000)
If(NOT Connected())
Connect("The Internet")
EndIf

EndSub

If you do not have a 480 x 640 or 480 x 800 phone or if this does not work for you please try this script to get me the points I need to improve this script.

# PickPoints.mscr

Run("\Windows\CMBandSwitching.exe")
WaitForActive("Band", 10)
Sleep(300)

SleepMessage( 2, "Select center of first (top) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput1 = "^NL^First:^NL^X1 = " & aMouse[1] &"^NL^Y1 = " & aMouse[2]

SleepMessage( 2, "Select center of second (middle) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput2 = "^NL^Second:^NL^X2 = " & aMouse[1] &"^NL^Y2 = " & aMouse[2]

SleepMessage( 2, "Select center of third (bottom) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput3 = "^NL^Third:^NL^X3 = " & aMouse[1] &"^NL^Y3 = " & aMouse[2]

Sleep(300)
MouseClick("Band", aMouse[1], aMouse[2])
Sleep(300)

SleepMessage( 2, "Select center of Done button after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput4 = "^NL^Done:^NL^X4 = " & aMouse[1] &"^NL^Y4 = " & aMouse[2]

Sleep(300)
MouseClick("Band", aMouse[1], aMouse[2])
Sleep(1500)

SleepMessage( 2, "Select center of OK button after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput5 = "^NL^OK:^NL^X5 = " & aMouse[1] &"^NL^Y5 = " & aMouse[2]

SleepMessage( 2, "Select center of Cancel button after this screen closes." )
Sleep(3000)

WriteFile("\band_click.txt", "Screen width: " & ScreenWidth() & "^NL^Screen height: " & ScreenHeight() & sMSGOutput1 & sMSGOutput2 & sMSGOutput3 & sMSGOutput4 & sMSGOutput5)
Message("Please send me these data. They are saved in root directory \band_click.txt^NL^")

Remove the .txt from the end of the script files.