Posts Tagged ‘C#’

Free Rating Updater for MyMovies and Windows Media Center

I love my media center, even more since I found the awesome (free) plugin MyMovies, which allows you to add meta information to your movies. Besides covers of dvds they provide a platform to add movie description, artist details and more. One additional field which is available for every movie is the “Rating” field.
Unfortunately, this [...]

Comments (12)

Worlds largest Media Center Remote Contol?

How big is big enough?

Worlds largest Media Center Remote Control?

A few weeks ago I ran into a huge remote control in a local mall at Brookstone. It did not even take me a minute to decide that this awesome piece of hardware needs to be mine. Not too long after buying this remote control, I [...]

Comments (56)

Call Managed C# Method from JavaScript Code

After searching quite long to find a way to call a C# Method from any JavaScript Code which is hostet in a WinForms Webbrowser Control, I found this one here:

C# Code
[ComVisible(true)]
public class ScriptManager
{
Form mForm;
public ScriptManager(Form form)
{
mForm= form;
public void MethodToCallFromScript()
{
mForm.DoSomething()
}
}
}
public class MyForm : Form
{
private Webbrowser mBrowserCtrl;
public MyForm()
{
mBrowserCtrl = new Webbrowser();
mBrowserCtrl.ObjectForScripting= new ScriptManager(this);
}
public void DoSomething(){}
}
JavaScript Code
function HandleSomething()
{
window.external.MethodToCallFromScript();
}

Comments (6)

Playing Sounds in Windows Mobile

After working a bit with the new Windows Mobile 6 SDK i tried to play sounds located on the device. Since there are a few tricky steps, here is the code (C#):

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace SoundMachine
{
public class Sound
{
[DllImport("CoreDll.dll", EntryPoint = "PlaySound", SetLastError = true)]
private extern static int PlaySound(string szSound, IntPtr hMod, int flags);
private [...]

Comments (1)