Hi, The idea is to read specific media player registers. to get current played song informations: In .net you can use the RegistryKey class to have acces to registers: Note: Reg path from WMP: Software\Microsoft\MediaPlayer\CurrentMetadata RegistryKey regData = Registry.CurrentUser.OpenSubKey("Software\Microsoft\MediaPlayer\CurrentMetadata", false); if (regData != null) //you have to do this check, to prevent from a null reference exception { string currSongTitle = regData.GetValue("Title", "No Title") as string; //... // Check google to see other WMP Keys... } Hope this help
lisan_al_ghaib
Posts
-
How Syncronize..in C#??? -
EEPROM Smart Cardewww ! a very very very very very bad question ! Type of EEProm, How this eprom est connected to your PC... We need details please !
-
Print the information on a Windows Form:laugh:
-
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.Did you check in frm (the form you want to show) Load event or in its Constructor?
-
[Message Deleted]yes ! stupid melody that you hear when you weak up in the morning. BinnaryWriter :laugh: ..nice class we shoud ask Microsoft to bring us a 'Binnary' Namespace
-
Structure converstion to Bytearray+1 dude !
-
Structure converstion to BytearrayHello ! Don't be so Rude :) we all were beginners some time !
-
Structure converstion to Bytearraylet suppose your have this Class :
class SomeClass
{
double l;
double [] m = new double [10]; //double array
string s;byte [] ToByteArray ()
{
List<byte> b = new List<byte> ();
b.AddRange (BitConverter.GetBytes (l));
for (int i = 0; i < m.Length ; i++)
b.AddRange (BitConverter.GetBytes (m [i]));
char [] tabc = s.ToCharArray();
for ( int i = 0 ; i < m.Lenght ; i++)
b.AddRange (BitConverter.GetBytes (tabc [i]);return b.ToArray();
}
}
//usage :
SomeClass c = new SomeClass ();
byte [] b = c.ToByteArray(); -
Structure converstion to Bytearrayokey then the best way to do this is to define a sort of a 'communication protocol' between two devices : First byte : message lenght (or data length) data bytes : your data byte that holds checksum [data length][.....data.....][checksum] then in your C# program you have to create a class that build the message you have to send : calculate length convert your structure on a data array (*) calculate the checksum -> So here we are in the core of your question: the best way is to loop over EACH element of your strucuture convert it into byte array and the add it to data array use BitConverter class : BitConverter.GetBytes (T) -> T is an elementary type (float, double, char, int, etc...)
-
Structure converstion to BytearrayYou are running serial port communication between 2 managed program?
-
[Message Deleted]class PleaseWork
{
public void getPermission ()
{
MyComputer.GetBinnaryPermission (directory); // oh crap it doesn't work ! Let's ask question on codeproject forum !!! , MSDN ? what's MSDN ? huh. NO !!!!}
} -
Temp Foldergoogle is loosing its mojo :-\
-
Common fileHello, You have to think Classes not file. The best solution is to create a Class libraby project (DLL) that contains your classes Then if you want to use it, you reference it in your current project. That's it !
-
What is := in VB.net[Message Deleted]
-
how can i change machain dateThere is a little fix : correct solution
public class Win32
{
private Win32()
{
}\[StructLayout(LayoutKind.Sequential)\] public struct SystemTime { \[MarshalAs(UnmanagedType.U2)\] public short Year; \[MarshalAs(UnmanagedType.U2)\] public short Month; \[MarshalAs(UnmanagedType.U2)\] public short DayOfWeek; \[MarshalAs(UnmanagedType.U2)\] public short Day; \[MarshalAs(UnmanagedType.U2)\] public short Hour; \[MarshalAs(UnmanagedType.U2)\] public short Minute; \[MarshalAs(UnmanagedType.U2)\] public short Second; \[MarshalAs(UnmanagedType.U2)\] public short Milliseconds; } \[DllImport("kernel32.dll")\] public static extern void GetLocalTime( out SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern void GetSystemTime( out SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern bool SetSystemTime( ref SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern bool SetLocalTime( ref SystemTime systemTime); }
....
in you method do this :
Win32.SystemTime sysTime;sysTime.Day = 13; // do all needed modification on date and time... //.... Win32.SetSystemTime(ref sysTime);
Make sure that you got admin rights.
-
Creating Instance of button at run time.Buy a book int left = 0; int space = 1; //pix for ( int i = 0 ; i < nbButtons ; i++) { Button b = new Button(); b.name = i.ToString(); b.Text = i.ToString(); b.Left = left; c.Controls.Add (b); //C is a user control left += b.Left + b.Width + space; }
-
8-O fixing C# class in unsafe code block???You have to use IntPtr instead of void use Marshall.CoTaskMemAlloc method to allocate Marshall.CoTaskMemFree method to free after using your struct
-
Class inheritance questionBar bar 1 = new Bar(); Bar bar2 = bar1;
-
how can i change machain dateHello you can do this using some Win32 API functions (warning : unmanaged code) please see this : http://bytes.com/forum/thread242372.html[^]
-
Class inheritance questionhuh sorry i dont understand