|
[e]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
//#define Leen "梦の続きへ ";
namespace HD_Internet_TV
{
public partial class _MainForm : Form
{
public _MainForm()
{
InitializeComponent();
}
const string NewLine = "\n";
const string text = "HD Internet TV";
const int MF_SEPARATOR = 2048;
const int MF_BYPOSITION = 1024;
const int IDM_MYITEM = 12345;
const int GWL_WNDPROC = -4;
const int WM_SYSCOMMAND = 274;
const int WM_KEYDOWN = 256;
const int WM_KEYUP = 257;
const int SW_SHOW = 5;
const int WM_GETTEXT = 13;
const int WM_Settext = 12;
const int IDM_MYEVEN = 2031619;
const string Lie1 = "http://www.tv123456789.com/ITV189高清网络电视.exe";
const string Lie2 = "http://www.tv123456789.com/v8/index.html?v=1&d=1&alliance_id=105183&sv=133234551";
const string URL = "http://tv.zqredstar.com/hdtv/index.htm";
const string HomeURL = "http://hi.baidu.com/windowsvipcuv/";
[DllImport("shell32.dll", EntryPoint = "ShellExecuteA")]
public static extern int ShellExecuteA(
int Hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
short nShowCmd
);
[DllImport("user32.dll", EntryPoint = "FindWindowA")]
public static extern int FindWindowA(string ClassName, string TextName);
[DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
public static extern void SetProcessWorkingSetSize(int C1, int C2, int C3);
[DllImport("user32.dll", EntryPoint = "SetWindowLongA")]
public static extern int SetWindowLongA(int Hwnd, int nIndex, int dwNewLong);
[DllImport("shell32.dll", EntryPoint = "ShellAboutA")]
public static extern int ShellAboutA(int HWnd, string Text, string Tip, int HIco);
[DllImport("shlwapi.dll", EntryPoint = "PathIsDirectoryA")]
public static extern int PathIsDirectoryA(string pszPath);
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
public static extern int SendMessageA(int Hwnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "AnimateWindow")]
public static extern void AnimateWindow(int hwnd, int dwTime, int dwFlags);
[System.Runtime.InteropServices.DllImport("dwmapis.dll", EntryPoint = "ifosvar")]
private static extern bool ifosvar(double a);
[System.Runtime.InteropServices.DllImport("dwmapis.dll", EntryPoint = "OnAero")]
private static extern void OnAero
(
int A1,
int A2,
bool A3,
int A4,
int A5,
int A6,
bool A7,
int A8,
int A9,
int A10,
int A11,
bool A12
);
[DllImport("advapi32.dll", EntryPoint = "OpenEventA")]//
public static extern int OpenEventA(int dwDesiredAccess, bool bInheritHandle, string lpName);
[DllImport("advapi32.dll", EntryPoint = "CreateEventA")]
public static extern int CreateEventA(int lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
static WebBrowser explorer=new WebBrowser();
[DllImport("user32.dll",EntryPoint="CallWindowProcA")]
public static extern int CallWindowProcA(int lpPrevWndFunc, int hwnd, int uMsg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "MessageBoxA")]
private static extern int MessageBoxA(int Hwnd, string Tip, string Text, int Val);
private void _MainForm_Load(object sender, EventArgs e)
{
CshIe();
this.Text = text;
setH_W();
AnimateWindow(GetHwnd(), 1288, 24);
SetPeek();
SetTouMing(GetHwnd(), this.BackColor.ToArgb(), random(255,188), 3);
// IsPidExist();
}
void RegisterClass()
{
//TD::注册回调
}
const int IDM_yes = 123;
const int IDM_qlj = 758;
static int lpPrevWndProc = new Int32();
int WindowProc(int hwnd,int uMsg,int wParam,int lParam)
{
if(uMsg==IDM_qlj || uMsg ==IDM_yes)
{
return 0;
}
return CallWindowProcA(lpPrevWndProc, hwnd, uMsg, wParam, lParam);
}
// 此代码块做屏蔽右键回调函数块
static Timer Timer = new Timer();
void setTimer(int TimeMs)
{
Timer = this.timer1;
Timer.Interval = TimeMs;
}
void setH_W()
{
Hige = this.Height;
Whidh = this.Width;
}
const string tip1 = "已存在无法重复运行实例";
const string tip2 = "MyAppVideo";
const string tip3 = "信息:";
const int tipBtn = 64 + 0;
private void IsPidExist()
{
if (OpenEventA(IDM_MYEVEN, false, tip2) != 0)
{
MessageBoxA(GetHwnd(),tip1,tip3,tipBtn);
this.Close();
}
CreateEventA(0, false, false, tip2);
}
private void CshIe()
{
explorer = this.webBrowser1;
}
int GetHwnd()
{
int poiuiqnq = new Int32();
string[] uihjniu = new string[2];
uihjniu[1] = this.Text;
poiuiqnq = FindWindowA(uihjniu[0], uihjniu[1]);
return poiuiqnq;
}
int random(int MaxVal,int MinVal)
{
Random Random = new Random();
return Random.Next( MinVal,MaxVal);
}
void SetPeek()
{
if (ifosvar(6) == true)
{
int Hwnd = GetHwnd();
int rgb = this.BackColor.ToArgb();
OnAero(Hwnd, 32, true, rgb, 255, 2, true, this.Top, this.Left, this.Width, this.Height, true);
}
}
static int Register = new Int32();
private void _MainForm_Shown(object sender, EventArgs e)
{
Register++;
if (Register > 1)
{
return;
}
explorer.Navigate(URL);
object Object = new object();
EventArgs Evag=new EventArgs();
timer1_Tick(Object, Evag);
}
static int Hige = new Int32();
static int Whidh = new Int32();
private void _MainForm_Resize(object sender, EventArgs e)
{
if (this.Width < Whidh)
{
this.Width = Whidh;
}
if (this.Height < Hige)
{
this.Height = Hige;
}
}
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "GetWindowLongA")]
private static extern int GetWindowLongA(int hwnd, int nIndex);
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetLayeredWindowAttributes")]
private static extern int SetLayeredWindowAttributes(int hwnd, int crKey, int alrf, int dwFlags);
bool SetTouMing(int CHwnd, int CrKey, int bAlpha, int dwFlags)
{
int Ret = new int();
Ret = GetWindowLongA(CHwnd, -20);
Ret = Ret | 524288;
SetWindowLongA(CHwnd, -20, Ret);
if (SetLayeredWindowAttributes(CHwnd, CrKey, bAlpha, dwFlags) != 0)
{
return true;
}
return false;
}
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "FlashWindow")]
private static extern int FlashWindow(int Hwnd, bool dwY);
const int IDM_MYFY=-1;
private void timer1_Tick(object sender, EventArgs e)
{
SetProcessWorkingSetSize(IDM_MYFY,IDM_MYFY,IDM_MYFY);
}
const int F5 = 116;
private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
//if (e.IsInputKey == true)
//{
int KeyVal = e.KeyValue;
System.Diagnostics.Debug.Write(KeyVal);
if (KeyVal == F5)
{
explorer.Navigate(URL);
}
//}
}
}
}
[/e]
下载学习地址::
HD Internet TV.zip
(329.54 KB, 下载次数: 3)
|
|