Console Apps for Silent, Vibrate & Normal Profiles. Profile Switch utility. - Windows Mobile Software Development

Could not find this kind of simple app on xda so I wrote 3 quick apps. No screens or user interaction just execute them to set sound profile to Silent, Vibrate or Normal. SHould work with WM6.1 and up with or without Touchflo. You do need CF3.5
3/12/2010: Added PFSwitch utitlity which has the follwing switches:
Run with no switch:
Read current phone setting and move to the next profile. This toggles between Normal, Vibrate & Silent.
Run with 1 switch:
onoroff = toggle between on and silent only
onorvibe = toggle between on and vibrate only
normal = go to normal mode
vibe = go to vibrate mode
silent = go to silent mode
Run with 3 switches:
normal x y = go to normal and set system volume to x and ring volume to y (note x & y can be 0,20,40,60,80,100)
Run with 5 switches:
normal x y run runparms = same as 3 switches but when exiting run program 'run' and send params 'runparams'
Some examples:
PFSwitch silent = set phone to silent profile
PFSwitch normal 60 100 = set phone to normal sound with system sound at 60% and ring volume at 100%
PFSwitch normal 100 100 "\windows\iexplore.exe" "www.xda-develpoers.com" = set sound to normal both system and ring at 100% and when done launch internet explorer to go to xda website
PFSwitch silent 0 0 "\Windows\ctlpnl.exe" "cplmain.cpl,11,0" = set phone to silent and when exiting run Control Panel and open to tab 11 ident 0 (Menu Items I think)
Note: to run a program you must have the complete path since win mo does not allow relative paths.
PFSwitch V2.0
Added 9 new switches which are optional.
Switch 6 = ACTimeout
Switch 7 = ACTimeoutUnchecked
Switch 8 = BatteryTimeout
Switch 9 = BatteryTimeoutUnchecked
Switch 10 = Brightness
Switch 11 = ACSuspendTimeout
Switch 12 = BattSuspendTimeout
Switch 13 = ACSuspendTimeoutSave
Switch 14 = BattSuspendTimeoutSave
Example:
PFSwitch "" "" "" "" "" "" "" 30 0 3 "" "" "" "" would set backlight timeout on and at 30 seconds and brightness to 3

thanks
Thanks for this ebernazz2.
Been looking for ages for something just like this.

niccccccceee...

These sort of apps are always usefull. I just wish there was an app like this to toggle between USB and ActiveSync...
You placed 3 copies of the same file in each cab Instead you should have just placed the exe in a folder inside %CE1% ("Program Files" folder according with OS language) and the shortcut in %CE11% ("Start Menu/Programs" files folder according with OS language)
Would you be willing to make a version that toggles normal->vibe->mute each time the app is launched and with command line support (so we can create shortcuts with the command to select which profile to set)?

Sure I will make a single app that goes from normal to vibrate to silent if no command line argument is passed and if an argument is passed then it will go to that one.
Eric

Here you go. I don't have my phone with me to test this so please let me know if it does not work.
PFSwitch will toggle between normal, vibe and silent if run without any command line input. If you prefer to have a command line input to get to a specific profile then simply run it with one of the following switches:
normal
vibe
silent
Eric

Thank you! Already tested in my device and both toggle and command functions are working

I don;t understand what you mean by an app from USB to activesync. I don;t ever connect my phone to my PC so is tat what you are asking for?
Eric

Recent phones (like the Samsung Omina) have the ability to either connect to a PC by means of ActiveSync (RNDIS) or real USB connection (Mass Storage mode for memory cards or internal storage).
The advantage of the Mass Storage mode is that it's much faster and can be used in a Win PC without ActiveSync or other OSes.
I currently have a link in my today screen to a dirty MortScript I wrote (but most likely it's written in a device specific way and only works in the Omnia):
Code:
usb = RegRead ( "HKLM", "Drivers\USB\FunctionDrivers", "DefaultClientDriver" )
If ( usb eq "RNDIS" )
Run ( "\Windows\USBSetting.exe" )
Sleep ( 200 )
SendSpecial ( "Down" )
Sleep ( 50 )
SendSpecial ( "CR" )
Sleep ( 50 )
SendOK
ElseIf ( usb eq "Mass_Storage_Class" )
Run ( "\Windows\USBSetting.exe" )
Sleep ( 200 )
SendSpecial ( "Up" )
Sleep ( 50 )
SendSpecial ( "CR" )
Sleep ( 50 )
SendOK
EndIf

See my PM ans see if that helps. If not let me know.
Eric

I get you now. Let me see if it is just a registry update or do I have to call a function in core.dll.
Eric

I think that just changing the registry won't work (or at least I wasn't able to do a MortScript to do so... though I'm really not a coder).

frmariam said:
I think that just changing the registry won't work (or at least I wasn't able to do a MortScript to do so... though I'm really not a coder).
Click to expand...
Click to collapse
You are correct. The problem comes from the necessary events that winmo needs. In essence the app you used is loading the appropriate drivers that are specific to the hardware manufacturer. That needs to happen through ActivateDeviceEX function which is why simple setting of the registry won't help (it actually will assign the a new number in the registry HKLM\Drivers\active). I see no easy way around that coupled with the problem that the driver is manufacturer dependent.
Eric

Sounds like a big hassle for such an apparently small function...
I really hate how so much stuff in WinMo is device specific though it just seems like a side effect to the fact that Microsoft leaves all these things up to the device manufacturers... Maybe this will change in WinMo7 (not that it'll be available for my device anyway...). I really wish that the mobile OSes were in many aspects more like the PC OSes (like the fact you can install the OS if your device has the specs to run it rather than your manufacturer choosing if you are "allowed" to update it).

ebernazz2 said:
Could not find this kind of simple app on xda so I wrote 3 quick apps. No screens or user interaction just execute them to set sound profile to Silent, Vibrate or Normal. SHould work with WM6.1 and up with or without Touchflo. You do need CF3.5
Click to expand...
Click to collapse
Hi, I am using action screen to build a phone profile switcher: night, gps, car, outdoor, home, internet, mute...The code controls succesfully the system volume but I do not seem to update with success the ringer volume. Would it be possible to add a functionality to your app to define mode (mute, silent, normal) and at the sametime setup the volume for both ringer and system? Or could you help me understand if it is something that can be controlled writing to the registry? it is device specific? the scripts I found so far do not work in my polaris

Not sure what you mean.... I have an app that rotates from silent to vibrate to ring or you can set a switch to go directly to a profile. If you want to control sound or profile I can give you code but it would be Visual Studio code. What is Action Screen? IF you are asking if the system and ringer volume require 2 methods to set the answer is yes. You have to set both if you want both to change. Do you want to see the difference between setting the system sound vs ringer sound?
Eric

OK, actionscreen is an old htc program used to launch new sms, new mms and so on. It is just a popup menu (fullscreen) that gets away if not used after a couple of seconds. It is simply an app that has shortcuts written to the registry and launches them.
In my case I have not been able to start using visual studio, so I usually work with mortscript to launch scripts. In combination with any popupmenu like actionscreen I launch mosrtscript files that change the profile: eg my car profile will set bt discoverable, wifi off, full brightness, etc. my night profile with mute the system sound but keep the ringer volume in case someone calls for something important. My internet profile will open wifi, disable bt, etc. Using mortscipt I am able to change the icon so when I choose a profile the wifi icon gets red if activated and the profile icon gets the image of the active profile.
So basically I want an exe or mortscript file that can do two things at the same time: switch or set the mode (mute, silent, vibrate) and define the volume for the ringer and for the system. I do not know if it is more clear what I am looking for ?¿!!'¡'¿?!
thanks

I get you now.
I could write a .net app that takes 3 parameters. Lets say I call it SetSound2.
You would then use SetSound2 x y z where x would be mute, vibe or normal - and y would be the system volume level (20,40,60,80,100 percent) - and z would be the ringer volume (same numbers as y).
Would that help you?
Eric

ebernazz2 said:
I get you now.
I could write a .net app that takes 3 parameters. Lets say I call it SetSound2.
You would then use SetSound2 x y z where x would be mute, vibe or normal - and y would be the system volume level (20,40,60,80,100 percent) - and z would be the ringer volume (same numbers as y).
Would that help you?
Eric
Click to expand...
Click to collapse
That's just how I imagined it !!! Would you do that ??
Thanks Eric

Sure. I will write that tonight after work and post it for you as long as you test it out and let me know if is doing what you desire.
Eric

Related

TP2 set to wake up automatically

Is there any way to set TP2 wake up automatically when a new message arrives? As far as I noticed, assuming that the phone is already in sleep mode, you simply hear the notification sound and essentially need to press POWER button in order to read the message.
Try edit the registry and reboot
Navigate to:
HKLM\Drivers\BuiltIn\RIL\
DisableSMSWakeUpEvent = 0 (default 1)
am i missing something? mine automatically wakes up for any type of message

[APP]SVMPowerMgr 2.0 - Power comm. utility

Hello.
This is the "reloaded" of SVMPowerMgr 1.0.
With this app. You can:
- turn off the screen of Your device
- put the device in suspended mode
- soft reset the device
- turn off the device (HTC devs.).
- turn on/off wifi
- turn on/off phone module
- turn on/off bluetooth (make discoverable/invisible)
- switch phone bands Auto-2G-3G
You also can create 7 shortcuts to the program with parameters:
0 - turn off the screen of Your device
1 - put the device in suspended mode
2 - soft reset the device
3 - turn off the device(HTC devs.).
4 - turn on/off phone module
5 - turn on/off wifi
6 - turn on/off bluetooth
somethig like this
[simbols count]#"[path to program]SVM Power Mgr.exe" [parameter]?[path to icon file you want to use],-[icon index]
You can change the images of backrounds button separator and buttons, they will be located in "Images" folder after install. With one restriction: now the buttons are black, so if you change the back of main program, consider this ...
Remarks: To close the main window you must tap anywhere outside the buttons or in space between buttons. Also to close additional windows tap the Close button or empty space of window.
P.S.
On/off bluetooth works well on Microsoft and Broadcom stacks, but discoverable/invisible mode for bluetooth is working just on Microsoft stacks, on broadcom is to be developped
P.S.S.
Supported screen resolutions: QVGA (240x320), Square (240x240), SquareQVGA (320x320), VGA(480x640), Square VGA (480x480), WVGA (480x800)
Regards.
Seems really useful. Gonna try it with powerbutton long press
Looks promising....will give this a whirl...thx
hello and thaks. i am looking for something like this.
happy new year
Looks useful... Gonna try it.
Thanks for sharing.
Best regards
It looks awesome. Will give it atry on my phone.,..
Looks great, thank you very much!
It works but there is no icon on each button on my HD. Using stock ROM
Works great on my Diamond. The only thing that does not work is the 3G and 2G switch, which I assume is because I am on CDMA. Would it be possible to get the button to switch from Ev (3)G to 1x? Good work.
mwalt2 said:
... Would it be possible to get the button to switch from Ev (3)G to 1x? Good work.
Click to expand...
Click to collapse
Hi,
I'll try to find a way for this.
Best regards.
Error
For my device it can do almost all it promises including turning off the gsm but turning it on or switching between 2G/3G does nothing except gives me a dialog box named "Warning!" that containins the sentence
"The Phone status can not be switched."
Also turning the gsm and 3G on/off with HTC comm manager works just fine but as soon the gsm gets turned off by svmpm the HTC one also looses control over the gsm module (including 3G switch). I love your tool but how to get over this case?
I've got a feeling that this app has one of the best forum-replies per downloads ratio. I mean people just use it and don't complain. So great app when mapped to a comfortable hardkey. My issue was rare, so download it!
Hello and thanks for the program. I have instaled in my HD and mapped to one of the home bottom button. I have an spasnish stock ROM 1.56 and the final button doesn´t work and I would want to link it to another application like mylight. How can I make this?
Thanks for this applicatin
Missing icons
The app functions correctly for me, but the icons are missing (the text for each button are present). Anyway to bring the icons back?
Thanks
MEG
HTC HD2
Thanks a lot.
A very useful app for my GPS guided treeking.
works very well, thank you very much!
Example to create a shortcut please
s.virtan said:
You also can create 7 shortcuts to the program with parameters:
0 - turn off the screen of Your device
1 - put the device in suspended mode
2 - soft reset the device
3 - turn off the device(HTC devs.).
4 - turn on/off phone module
5 - turn on/off wifi
6 - turn on/off bluetooth
somethig like this
[simbols count]#"[path to program]SVM Power Mgr.exe" [parameter]?[path to icon file you want to use],-[icon index]
Regards.
Click to expand...
Click to collapse
Dear Virtan, would you please give me an axample to create a shortcut please.
I think I don't know about [symbol count] and [parameter]?...
What should i write (i use resco explorer) when i want to create a shortcut, for suspend for example...
Thank You
EDIT :
It's okay...I found it..i just add number 1 after the shortcut.
For example :
"\Program Files\SVM Power Mgr\SVM Power Mgr.exe" 1
But Still don't know how to change the icon.
PS:
When i use this shortcut as a link to SPB Mobile Shell i found that everytime i wake up the device, the device starting with "something working" logo (circle that quartered and moving). This is not found when i use the SVM Power Mgr usual link (with menu). Any suggestion?

EvC++ and power management(running apps during standby)

Hi guys.
I am looking for a solution,that can enable me to use some time-dependent procedures in my software,while the device is in standby mode.
The typical example is the alarm clock.
I want to develop for me a chime application,that will play the sound each hour,even tough the device "sleeps".
Can I achieve it in Embedded Visual C++ and can anyone show me the way,how to?
Thanks.
I think you should check out CeRunAppAtTime and CeSetUserNotificationEx APIs. What about telling them to launch some sort of notification application (sending a message), trigger a named event ol play your sound?
When I wrote RockClock I used the SmartDeviceFramework (OpenNetCF).
It has RunAppAtTime to run the app and wake the device and also the LargeTimerInterval which tricks the phone into thinking there's an incomming call and wakes it up from almost any state.
The largetimerinterval timer also continues to run when the device is in standby whilst normal timers are suspended until the device wakes up from standby.
Used with SetSystemPowerState it all works well.
Well,thank you for your suggestion.
Can you please provide me some working example code?
There's this one that will power on the device completly (C#):
Code:
[DllImport("coredll.dll")]
protected extern static UInt32 SetSystemPowerState(String pwsSystemState, UInt32 StateFlags, UInt32 Options);
protected static readonly UInt32 POWER_STATE_ON = 0x00010000;
protected static readonly UInt32 POWER_FORCE = 0x00001000;
SetSystemPowerState(null, POWER_STATE_ON, POWER_FORCE);
How to get system power state names: http://peterfoot.net/HowToGetSystemPowerStateNameAndFlags.aspx
CeRunAppAtTime information @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll.cerunappattime
SetDevicePower information @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll/SetDevicePower.html
SetSystemPowerState info @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll/SetSystemPowerState.html#
Info on waking the device using notifications: http://objectmix.com/dotnet/98395-waking-up-device-specific-time-vb-net.html# - using this you can play a sound at a specific time too
Manipulating the backlight (lcd): http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx
If you need to convert C# to VB.NET or viceversa then this is a handy link:
http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx
Hope you find these useful...let us know how you get on. I'm knew nothing of .NET before January and learnt a lot of things used in my alarm clock from
the pages listed above.
Hello.
I remembered about this question,but I found following:
Maybe I can use this function to power device on,but my software doesn't know,when that should be powered on.
I cannot use timer,because standby mode disables timer in my app,so I cannot monitor the time (each second).
Any solution for this please?

[Q] Inadvertently decreased ringer volume and missed calls

Sometimes I accidently turn ringer volume down low (not mute) and miss an important call.
I’ve found apps such as Ringer Volume (Android-Lab) to reset it at given times, however they all wants ‘full Internet access’ don’t know if I like that with an app that will be constantly running and with my limited data allowance?
Another option would be a taskbar icon showing my volume level; however I cannot find any such widget.
It’s not mute that give me the problem it’s when I decrease the Ring Volume sometimes by accident when holding my Desire HD, with CyanogenMod 7.
Anyone got any suggestions on this?
there's an app called Settings Profile that u can set rules to do stuff, so u can set a rule to keep invoking a certain profile at whatever interval you want. The Lite version can only set 1 rule so I am not sure if that's good enough for you or not.
Hi Lukesky, thanks for taking the time to help.
lukesky said:
there's an app called Settings Profile that u can set rules to do stuff, so u can set a rule to keep invoking a certain profile at whatever interval you want. The Lite version can only set 1 rule so I am not sure if that's good enough for you or not.
Click to expand...
Click to collapse
I think I had looked at Setting Profiles before but just had another look and my concern with it is that it takes Full Internet Access, perhaps I’m being paranoid but I only have 20Mb of data per day and then the price per Mb goes up dramatically, let alone when I’m roaming, OK I know I could turn Data off if I wanted. So do you think the Lite App will be using data via its internet access?
here u go buddy...its simple quick and fast.... i use it all the time and place as widget
Thanks Lalitehgal, I appreciate your help however unless I’m mistaken this widget has no option for an auto timed volume increase, and my problem is I sometimes do not realize I have decreased the volume while holding the phone.
@richardsoffice: in my opinion you should definitely not be required to adjust ringtone or notification volume manually. Because once - in office - you are satisfied, but then - on the street - you just don't hear anything. The phone should adjust the ringtone volume automatically based on ambient noise and phone position (pocket/out of pocket/table/...). Check out an app called IntelliRing.
Manually adjusting ringtone volume does not do any harm if your ringtone volume is managed by IntelliRing. So you can accidentally adjust volume as you want

Tasker

I just downloaded tasker. It seems like an amazing application but for the life of me, I can't figure out how to use it. Here are the tasks that I would like to program:
1) Set Wifi On when I am at home using cell towers
2) Set Wifi Off when I leave home
3) Change volume level to vibrate when I plug it in to the charger and allow emergency calls from certain phone numbers (I read you can do this)
4) Set volume level to highest setting when the phone is unplugged
5) Launch Pandora when my phone is connected to bluetooth
If someone could post step by step instructions that would be great. My hope is once I learn to do these, I can figure out how to program other tasks. Thanks.
ILowry282 said:
I just downloaded tasker. It seems like an amazing application but for the life of me, I can't figure out how to use it. Here are the tasks that I would like to program:
1) Set Wifi On when I am at home using cell towers
2) Set Wifi Off when I leave home
3) Change volume level to vibrate when I plug it in to the charger and allow emergency calls from certain phone numbers (I read you can do this)
4) Set volume level to highest setting when the phone is unplugged
5) Launch Pandora when my phone is connected to bluetooth
If someone could post step by step instructions that would be great. My hope is once I learn to do these, I can figure out how to program other tasks. Thanks.
Click to expand...
Click to collapse
1+2) New Profile "Home" State->Phone->Cell Near - Under Cell Tower press scan and walk around the house to register a few cell towers.
Go to tasks and create new task "Enter Home" - New - Wifi - On
Repeat with a task "Exit Home" - New - Wifi - Off
Go to profiles long press "Home" select Enter Home as entry task and Exit Home as exit task.
Same logic for the others
stathis95194 said:
1+2) New Profile "Home" State->Phone->Cell Near - Under Cell Tower press scan and walk around the house to register a few cell towers.
Go to tasks and create new task "Enter Home" - New - Wifi - On
Repeat with a task "Exit Home" - New - Wifi - Off
Go to profiles long press "Home" select Enter Home as entry task and Exit Home as exit task.
Same logic for the others
Click to expand...
Click to collapse
I can't get the silent mode one to work. It seems pretty simple so I don't know what I'm doing wrong. This is what I'm doing
Create Profile - State-Power-AC
Create Task-Audio- Silent Mode On- Set as Enter Task
Create Task-Audio-Silent Mode Off- Set as Exit Task
Doesn't work.
ILowry282 said:
I can't get the silent mode one to work. It seems pretty simple so I don't know what I'm doing wrong. This is what I'm doing
Create Profile - State-Power-AC
Create Task-Audio- Silent Mode On- Set as Enter Task
Create Task-Audio-Silent Mode Off- Set as Exit Task
Doesn't work.
Click to expand...
Click to collapse
It should work. Are you plugging it on AC or USB? Does the profile activate? (is it green?)
stathis95194 said:
It should work. Are you plugging it on AC or USB? Does the profile activate? (is it green?)
Click to expand...
Click to collapse
I'm plugging it into the wall. Here is a screenshot of my profile screen
ILowry282 said:
I'm plugging it into the wall. Here is a screenshot of my profile screen
Click to expand...
Click to collapse
Wow! I'm an idiot. I had tasked disabled. Haha! How do I create an exception for the silent mode task to have certain numbers get through?
ILowry282 said:
Wow! I'm an idiot. I had tasked disabled. Haha! How do I create an exception for the silent mode task to have certain numbers get through?
Click to expand...
Click to collapse
Have a look here:
http://tasker.wikidot.com/sleepmode
Tasker has unlimited capabilities. I find myself learning something new about tasker every single day
stathis95194 said:
Tasker has unlimited capabilities. I find myself learning something new about tasker every single day
Click to expand...
Click to collapse
Ditto! I also find myself completely baffled by it every day, despite having used it for years and being a programmer. The more complicated stuff you try to do, the more you'll be both amazed and confounded by the capabilities

Categories

Resources