/*____check.cs*/
using System;
using System.Text;
using System.Threading;
using System.Runtime.InteropServices;//DLL
using System.Timers;
class TouchMessageHooking
{
[DllImport("user32.dll")]
public static extern void keybd_event(byte vk, byte scan, int flags, ref int info);
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hwnd, int unMsg, IntPtr wparam, IntPtr lparam);
[DllImport("user32.dll")]
public static extern bool PostMessage(IntPtr hwnd, int unMsg, int wparam, int lparam);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string classname, string windowname);
int WM_KEYDOWN=0x0100;
int VK_F5=0x74;
int VK_ENTER=13;
int ____timeinterval=9000 * 4;
int index=0;
System.Timers.Timer tm_basic = new System.Timers.Timer();
System.Timers.Timer tm = new System.Timers.Timer();
IntPtr ____handle_mmmm = IntPtr.Zero;
IntPtr ____handle_popup = IntPtr.Zero;
int toggle=0;
int ____thread_sleep_time=400;
ConsoleKeyInfo keyinfo;
public void running()
{
tm.Elapsed += new ElapsedEventHandler(____time_tick);
tm.Interval = ____timeinterval;
tm.Start();
tm_basic.Elapsed += new ElapsedEventHandler(____time_tick_basic);
tm_basic.Interval = 1000;
tm_basic.Start();
while(true)
{
keyinfo=Console.ReadKey(true);
if(keyinfo.Key.ToString()=="Escape")
{
break;
}
else if(keyinfo.Key.ToString()=="Spacebar")
{
if(toggle==0)
{
Console.WriteLine("Stop");
tm.Stop();
toggle=100;
}
else
{
Console.WriteLine("Restart");
tm.Start();
toggle=100;
}
}
}
}
void ____time_tick_basic(object sender, ElapsedEventArgs e)
{
Console.WriteLine(DateTime.Now.ToString() + ">>>>Index:[" + index.ToString("0000") + "]");
Console.Title = DateTime.Now.ToString() + ">>>>Index:[" + index.ToString("0000") + "]";
index++;
}
void ____time_tick(object sender, ElapsedEventArgs e)
{
IntPtr ____result=IntPtr.Zero;
bool ____toggle;
string handleCaption="http://10.1.117.11:7101/getDashboardLink.do?dashboard_type=";
____handle_mmmm=FindWindow(null, handleCaption);
____toggle=PostMessage(____handle_mmmm, WM_KEYDOWN, VK_F5, 0);
Console.WriteLine(____handle_mmmm);
if(____toggle==true) Console.WriteLine("PostMessage succ!!");
else Console.WriteLine("PostMessage fail!!");
Thread.Sleep(____thread_sleep_time);
____time_tick_mmmm();
index=0;
}
void ____time_tick_mmmm()
{
IntPtr ____result=IntPtr.Zero;
bool ____toggle;
string handleCaption="Windows Internet Explorer";
____handle_mmmm=FindWindow(null, handleCaption);
____toggle=PostMessage(____handle_mmmm, WM_KEYDOWN, VK_ENTER, 0);
Console.WriteLine(____handle_mmmm);
if(____toggle==true) Console.WriteLine("PostMessage succ!!");
else Console.WriteLine("PostMessage fail!!");
}
}
class Program
{
public static void Main()
{
TouchMessageHooking nm = new TouchMessageHooking();
nm.running();
}
}
/*File Attach*/
'집동사니' 카테고리의 다른 글
차세대 데이터 처리 반도체 코딩 언어 VERILOG? VHDL? (0) | 2022.06.09 |
---|---|
[Redis] BLPop, LPop - Key를 이용한 데이타 추출 (0) | 2022.02.09 |
프로젝트별 언어종류,ㅡㅡㅡㅡ,ㅡㅡㅡㅡ (0) | 2021.12.30 |
TRIS MECHANISM( for example 10 * 10 array) (0) | 2021.12.30 |