Change windows default playback device - c#

How can I change the default playback device in windows 7, .net 4/4.5. I change the default device frequently and I want to make a little C# application to switch faster.
Is it even possible? Please help me.

Yes it is. However microsoft somehow did not want us to tamper with this. You can follow this project : http://www.codeproject.com/Articles/31836/Changing-your-Windows-audio-device-programmaticall
and adapt it to use with C#.
I have done something similar so it's not so hard to do!

I think you'll be able to do this by editing the registry. You get many programs to take snapshots of your registry. In doing this you'll be able to see where the changes are being made. It will take some time but is worth it. Also note that if this is Windows 7 you'll have to jump through hoops to be able to make some changes.
Good luck!

Related

Detecting if device is used as laptop or tablet

With many new devices such as the Vaio Duo, Vaio Flip, XPS 12, Lenovo Yoga, etc., which are all ultrabook/tablet convertibles, how can I detect which form factor its currently operating in? I know that the Vaio Duo switches performance modes depending on whether its being used as a laptop or as a tablet, so there should be some way, whether it be through pinvoke or something else.
In Windows, to directly check if your system is in tablet (or "slate") mode or not, you can call GetSystemMetrics(SM_CONVERTIBLESLATEMODE). For a discussion of a sample app that does this, check out https://software.intel.com/en-us/articles/how-to-write-a-2-in-1aware-application.
As well as checking on startup, you should be able to get a WM_SETTINGCHANGE message if the mode changes, which will have "ConvertibleSlateMode" as its LPARAM. In some cases, though, we've seen this message lost. So, it's a good idea to have a manual way to force a mode change in your app anyway.
Shouldnt your program work the same for all form factors, so there for it wouldnt matter which form factor there in.
Also have a look at this if you do need to access that sensor then this may help you.
http://archive.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=4906
This will get you all of your sensors.
Microsoft.WindowsAPICodePack.Sensors.SensorManager.GetAllSensors();
I've been working on this today. So I decided create a wrapper cause I haven't found one. I focused on universal portable class library (because of dispatcher used in monitor) but I can port to...
Here is:
https://github.com/daemun/DeviceExtCapabilitiesUniversal
Found a lot of information on this here: http://software.intel.com/en-us/articles/ultrabook-and-tablet-windows-8-sensors-development-guide

Register Application programmatically for Graphic card

I am trying to write a Setup for an application with Inno Setup, which is pretty neat by the way ;) , but now I am stuck with a problem regarding the graphiccard.
I am installing a 3D application and want to configure the program so that it uses a certain graphic card as default.
It sounded logical to me that somewhere in the registry must be a something to configure that.
I tried to change the default graphiccard manually und compare the changes in the registry but couldn't find any entrys relative to the changes
I know that programs like Adobe Photoshop are using the high performance graphiccards by default so there must be some kind of solution to my problem.
I am using inno script to write my setup but I can call external programs to do some tasks so I could write a C# program to execute this task.
This option is mostly relevant for Windows 7 and Windows 8 because I only saw it there.
Does anyone of you know how to change the default graphiccard of an application programmatically?
Your approach, sorry, sucks. This is not something you should do during setup. What if the card changes?
Check it during application start. Let the user choose if you do not find anything. Let him update. Not everyone has only one graphics card. People do update the graphics card. Why should I rerun setup just to get this done?
And it is quite easy to identify graphics cards, performance is another story. Which one is "high performance" in your eyes?

Exclusive App on Android with monodroid

I'm new in Android programation and Monodroid.
I would like to know if is possible and how to make one application that exlusively run in full screen and enable to use the device only across itself.
Best regards
Piercarlo
for the full screen mode see this
For the device only, i really have no clue what you mean.
Edit: you should really try to search a bit before posting question, it was really easy to find.

How to prevent terminal (Windows-CE) from shut-down after 5 minutes

How to prevent terminal (Windows-CE) from shut-down after 5 minutes
the terminal is Motorola MC3190 (Windows-CE) and if i dont touch the screen for 5 minutes
the terminal shut-down. how to prevent this ?
i need the solution in C# code.
thanks in advance
I initially voted to close, but have been thinking more about this, and I think the question you've asked may have been missing an important piece of information.
I think what you need to look at are the Windows CE Power Management functions, specifically SetPowerRequirement. This allows you to indicate that your application is using some device within the system. If not, it's unclear why your application, absent some device interactions, wants to prevent power management from doing its job.
No code needed for this. Go to Start->Settings->Power and uncheck the box next to "Turn off screen if device not used for".
If you tried to do this programmatically, you would be draining the battery power faster than the user intends. That will probably irritate your user.
If your heart is set on doing this, then you can modify the value in [HKLM]\System\CurrentControlSet\Control\Power\Timeouts
I also gave this answer on the MSDN forums
-PaulH
I dont know Windows-CE and i Dont know C#, but I found you an answer on google. Here you go. And now I want to try programing something for some station. Would be great home control device.
Is your Motorola MC3190 configured to Turn Off if it is running on Battery Power? Will it ever turn off if on External Power?
NOTE: I had to post as answer to show image, but this isn't really an answer.
EDIT: If this is what you are interested in, consider reading the device's SystemState property. There are many members to SystemState, and one of them just may be what you are after.
There is no easy technique for what you are wanting to do, because the devices are designed to power down when not in use. If the battery goes dead, the devices have to be completely reset. Make sure this is what you want to do, because there is a reason it is hard to get around.
You'll likely have to register for a BatteryStrength changed event (like >> THIS <<), then try to trick it somehow ...maybe by popping up a dialog box or simulating a key press.
You'll most likely need to P/Invoke some of the lower level coredll.dll functionality (examples >> HERE <<) to get what you want, as this stuff doesn't come wrapped up in the standard WinMobile SDK.
EDIT 2: Here's a Great example that someone wrote to read and control as much of the Power State as possible: techlicity blog I liked it so much I've copied the code to a class in my Mobile Project!

Touchscreen in CE5 blocking data traffic from peripheral

We are developing a platform with Windows CE 5 (soon to be upgraded to 6) in .Net CF 2 C#.
What we have recently discovered is that if we are touching the touchscreen while using our peripheral, the peripheral data trafic times out and our application crashes. So it seems like the touchscreen is blocking it. As a quick fix we would like to disable the touchscreen while using the peripheral, and the reenabling it.
So our question is, how do we do it?
Do we need some extra packages in the OS build or can we do it manually. We have had a look at touchpaneldisable() and touchpanelenable(...). But the enable method requires a handle to the callback function. So I have no idea on how to fix this.
From an application perspective tehre really isn't a fix. Touchpanel ddrivers a re alittle different than otehrs becasue they get loaded by (and into) GWES, rather than device.exe. They are not designed to be disabled and enabled, though some OEMs do provide the capability (typically by just masking the touch panel interrupt).
It sounds like the touchpanel sampling rate is really high and the device is saturating the processor when it startes sampling. It's something that the OEM probably needs to fix. Some OEMs do provide registry entries to adjust the driver behavior, so check with them to see if this might be available to you. In that case you may be able to fix the issue yourself.
If you have the BSP you might want to go through this blog post as it suggest possible bottle necks for the touch driver.

Categories

Resources