Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
- internal class Win32
- {
- [DllImport("user32.dll", SetLastError = true)]
- internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
- }
- public enum WinMsg
- {
- WM_SETTEXT = 12
- }
- class spotify : Form
- {
- public IntPtr getspotify()
- {
- return Win32.FindWindow("SpotifyMainWindow", null);
- }
- }
- class Exampleclass
- {
- public static void Main()
- {
- spotify s = new spotify();
- IntPtr h = s.getspotify();
- System.Console.WriteLine("Hello world!");
- System.Console.WriteLine(h); // prints out 262990
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement