Expressive automatic landing research

xiaoxiao2021-03-06  51

If you have already played the legend, then you must know that there is a good hanging, especially the exactly is better.

Recently, I studied the use of passive service agents, wind and snow verifiers and blood passive off-machine, if the user needs to hang up, it must be step by step, it is very troublesome.

Therefore, I wrote this automatic landing plug-in.

It is very easy to use FindWindowEx and SendMessage. It is very simple.

Say the function:

1. Automatically run, automatically log in

2. Automatic add private service

3. Automatically perform scripts, solve small retreat babies

4. Solve an exception window pop-up

At present, the legend of Yunlong is valid.

Don't say, post the code.

/.h

Class Cmirdlg: Public CDialog {// Constructionpublic: cmirdlg (cwnd * pparent = null); // Standard Constructionor

// Dialog Data // {{AFX_DATA (CMIRDLG) ENUM {IDD = IDD_MIR_DIALOG}; cstract m_psw; cstring m_user; //}} AFX_DATA

// ClassWizard generated virtual function overrides // {{AFX_VIRTUAL (CMirDlg) public: virtual BOOL DestroyWindow (); virtual BOOL PreTranslateMessage (MSG * pMsg); protected: virtual void DoDataExchange (CDataExchange * pDX); // DDX / DDV support / /}} AFX_VIRTUAL

// ImplementationProtace: hicon m_hicon;

// Generated message map functions // {{AFX_MSG (CMirDlg) virtual BOOL OnInitDialog (); afx_msg void OnSysCommand (UINT nID, LPARAM lParam); afx_msg void OnPaint (); afx_msg HCURSOR OnQueryDragIcon (); afx_msg void OnButtonBegin (); afx_msg Void ONTIMER (Uint NidEvent); AFX_MSG Void OnButtonSet (); AFX_MSG VOID ONBUTTON1 (); //}} AFX_MSG DECLARE_MESSAGE_MAP ()

private: BOOL CheckAllProgram (); void RegisterProgram (); void ActionScript (); BOOL SearchStr (LPCSTR lpBuf, int count, LPCSTR lpstr); BOOL GetScriptState (); void ReadInfoFromRegister (); void WriteInfoToRegister (); BOOL FindHotPanel (); BOOL IsLoginOK (); BOOL FindRichEdit (); BOOL FindHotCSpnLogin (); BOOL FindHotCSDlg (); BOOL Find51pywgButton (); BOOL Find51pywgDlg (); BOOL FindWgButton (); BOOL FindWgComBox (); BOOL FindWgDlg (); BOOL CreateWgDlg (LPCSTR lpAppPath , Process_information * pi); hwnd hwgdlg; // ë½½ þþ; ± ± h h h½ omþàà; ± h hwnd hwgbutton; // ë½ þþ ªÊ¼ °'Å ¥ HWND h51pywg; // 51pywg¾ä ± ú HWND h51pywgButton; // 51pywg °'Å ¥ ¾ä ± ú HWND hHotWnd; // ÈÈѪ¾ä ± ú HWND hHotLoadButton; // ÈÈѪμǽ¾ä ± ú HWND hHotEdit; // ÈÈѪ ± à¼¾ä ± ú HWND hHotUserEdit; HWND hHotPSWEdit; HWND hHotPanel; PROCESS_INFORMATION mypi [3]; int nState; int iReLoadTimeOut; DWORD ulTimeOut; char apppath [256]; BOOL bLoadState; CString strwgPath; CString str51PywgPath; CString strHotcsPath; CString strwgName; UINT uPort; Bool bautoload; bool bautosave; byte byteipaddress [4]; int instate;}; ****************** CPP ******** *******************************

// mirdlg.cpp: importation file //

#include "stdafx.h" #include "mir.h" #include "mirdlg.h" #include "dialogset.h" #ifdef _debug # define new debug_new # undef this_filestatic char this_file [] = __file __; # ENDIF

/// Caboutdlg Dialog Used for App AboutStatic Bool Callback EnumProc (HWND HWND, LPARAM LPARAM); Char Szsection [] = "íñ» úí¹¹¹ö × ¶ ¯ ° æ ";

Class Caboutdlg: public cdialog {public: capoutdlg ();

// Dialog Data // {{AFX_DATA (Caboutdlg) Enum {IDD = IDD_ABOUTBOX}; //}} AFX_DATA

// ClassWizard generated virtual function overrides // {{AFX_VIRTUAL (CAboutDlg) protected: virtual void DoDataExchange (CDataExchange * pDX); // DDX / DDV support //}} AFX_VIRTUAL // Implementationprotected: // {{AFX_MSG (CAboutDlg) / /}} AFX_MSG DECLARE_MESSAGE_MAP ()};

Caboutdlg :: Caboutdlg (): cdialog (caboutdlg :: IDD) {/ {{AFX_DATA_INIT (Caboutdlg) //}} AFX_DATA_INIT}

Void Caboutdlg :: DODATAEXCHANGE (CDataExchange * PDX) {cdialog :: DODATAEXCHANGE (PDX); // {{AFX_DATA_MAP (CaboutDLG) //}} AFX_DATA_MAP}

Begin_MESSAGE_MAP (Caboutdlg, cdialog) // {{AFX_MSG_MAP (Caboutdlg) // No Message Handlers //}} AFX_MSG_MAPEND_MESSAGE_MAP ()

/// cmirdlg dialog

Cmirdlg :: cmirdlg (cwnd * pparent / * = null * /): cdialog (cdialog (cmirdlg :: IDD, pParent) {/ {{AFX_DATA_INIT (CMIRDLG) m_psw = _t (""); m_user = _t (""); //}} AFX_DATA_INIT // Note That Loadicon Does Not Require A Subsequent Destroyicon in Win32 M_Hicon = AFXGetApp () -> Loadicon (iDR_mainframe);

void CMirDlg :: DoDataExchange (CDataExchange * pDX) {CDialog :: DoDataExchange (pDX); // {{AFX_DATA_MAP (CMirDlg) DDX_Text (pDX, IDC_EDIT_PSW, m_PSW); DDV_MaxChars (pDX, m_PSW, 20); DDX_Text (pDX, IDC_EDIT_USER , m_user); DDV_MaxChars (PDX, M_User, 20); //}} AFX_DATA_MAP}

BEGIN_MESSAGE_MAP (CMirDlg, CDialog) // {{AFX_MSG_MAP (CMirDlg) ON_WM_SYSCOMMAND () ON_WM_PAINT () ON_WM_QUERYDRAGICON () ON_BN_CLICKED (IDC_BUTTON_BEGIN, OnButtonBegin) ON_WM_TIMER () ON_BN_CLICKED (IDC_BUTTON_SET, OnButtonSet) ON_BN_CLICKED (IDC_BUTTON1, OnButton1) //}} AFX_MSG_MAPEND_MESSAGE_MAP ( )

/// cmirdlg Message Handlers

Bool cmirdlg :: oninitdialog () {cdialog :: OnInitdialog ();

// Add "About ..." Menu Item to System Menu.

// IDM_ABOUTBOX must be in the system command range ASSERT ((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);. ASSERT (IDM_ABOUTBOX <0xF000); CMenu * pSysMenu = GetSystemMenu (FALSE); if (! PSysMenu = NULL) {CString strAboutMenu; StraboutMenu.LoadString (ids_aboutbox); if (! straboutmenu.isempty ()) {psysmenu-> appendmenu (mf_separator); psysmenu-> appendmenu (mf_string, idm_aboutbox, straboutmenu);}}

// set the icon for this dialog. The framework does this automatic or //en the application's main window is not a dialog seticon (m_hicon, true); // set big icon seticon (m_hicon, false); // set small icon / / TODO: Add extra initialization here int i, len; if | {// DWORD error = GetLastError (); return FALSE;} iWinState = 0; GetModuleFileName (AfxGetInstanceHandle ((RegisterHotKey (m_hWnd, 0xA002, MOD_CONTROL MOD_ALT, VK_F7)!) ), apppath, 256); len = strlen (AppPath); i = 1; while (len> 0) {if (AppPath [len-i] == '//') {apppath [len-i] = '/ 0 '; Break;} i ;} ultimeout = 0; nState = 0; hwgdlg = null; // ë½½ þþ þ þ ± ± hwgcombox = null; // ë½½ þþààà ± hwgbutton = null; // ë½ þþ ªÊ¼ °'Å ¥ h51pywg = NULL; // 51pywg¾ä ± ú h51pywgButton = NULL; // 51pywg °'Å ¥ ¾ä ± ú hHotWnd = NULL; // ÈÈѪ¾ä ± ú hHotLoadButton = NULL; // ÈÈѪμǽ¾ä ± ú hHotEdit = NULL; // ÈÈѪ ± à¼¾ä ± ú hHotUserEdit = NULL; hHotPSWEdit = NULL; hHotPanel = NULL; SetTimer (1,1000, NULL); iReLoadTimeOut = 0; bLoadState = 0; ReadInfoFromRegister (); (! bAutoSave) if {m_User = "" ; m_PSW = ""; bAutoLoad = FALSE; WriteInfoToRegister ();} else {if (bAutoLoad) {UpdateData (FALSE); OnButtonBegin ();}} RegisterProgram (); UpdateData (FALSE); return TRUE; // return TRUE unless you set the focus to a control} void CMirDlg :: OnSysCommand (UINT nID, LPARAM lParam) {if ((nID & 0xFFF0) == IDM_ABOUTBOX) {CAboutDlg dlgAbout; dlgAbout.DoModal ();} else {CDialog :: OnSysCommand ( NID, LPARAM);}}

// If you add a minimize button to your dialog, you will need the code below // to draw the icon For MFC applications using the document / view model, // this is automatically done for you by the framework.void CMirDlg.: : Onpaint () {if (isiconic ()) {cpaintdc DC (this); // device context for Painting

SendMessage (WM_ICONERASEBKGND, (WPARAM) dc.getsafehdc (), 0);

// Center icon in client rectangle int cxIcon = GetSystemMetrics (SM_CXICON); int cyIcon = GetSystemMetrics (SM_CYICON); CRect rect; GetClientRect (& rect); int x = (rect.Width () - cxIcon 1) / 2; int y = (Rect.height () - Cyicon 1) / 2;

// Draw the icon dc.drawicon (x, y, m_hicon);} else {cdialog :: onpaint ();}}

// the system calls this to obtain the cursor to display while the user dress // the minimized window.hcursor cmirdlg :: ONQUERYDRAGICON () {Return (hcursor) m_hicon;}

void CMirDlg :: OnButtonBegin () {// TODO:! Add your control notification handler code here UpdateData (TRUE); bLoadState = bLoadState; if (bLoadState) {GetDlgItem (IDC_BUTTON_BEGIN) -> SetWindowText ( "× ¢ Ïú"); GetDlgItem (IDC_EDIT_USER) -> EnableWindow (FALSE); GetDlgItem (IDC_EDIT_PSW) -> EnableWindow (FALSE); GetDlgItem (IDC_BUTTON_SET) -> EnableWindow (FALSE);} else {GetDlgItem (IDC_BUTTON_BEGIN) -> SetWindowText ( "μǽ"); GetDlgItem ( IDC_EDIT_USER) -> EnableWindow (TRUE); getdlgitem (idc_edit_psw) -> EnableWindow; getdlgitem (idc_button_set) -> enableWindow (TRUE);}

IF (bloadState) nState = 1; else {:: seundMessage (hhotwnd, wm_close, 0, 0); // :: SendMessage (H51PYWG, WM_QUIT, 0, 0); // :: SendMessage (H51PYWG, WM_CLOSE, 0, 0) ;: SendMessage (hwgdlg, wm_close, 0, 0); :: TerminateProcess (mypi [1] .hprocess, 0);} // WriteInfotoregister ();

BOOL CMirDlg :: CreateWgDlg (LPCSTR lpAppPath, PROCESS_INFORMATION * pi) {CString str; STARTUPINFO startInfo; startInfo.cb = sizeof (STARTUPINFO); startInfo.lpReserved = NULL; startInfo.lpTitle = ""; startInfo.lpDesktop = NULL; startInfo. dwX = 0; startInfo.dwY = 0; startInfo.dwXSize = 0; startInfo.dwYSize = 0; startInfo.dwXCountChars = 0; startInfo.dwYCountChars = 0; startInfo.dwFlags = STARTF_USESTDHANDLES; startInfo.wShowWindow = 0; // SW_SHOWDEFAULT; startInfo.lpReserved2 = NULL; startInfo.cbReserved2 = 0; startInfo.hStdInput = GetStdHandle (STD_INPUT_HANDLE); startInfo.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); startInfo.hStdError = GetStdHandle (STD_ERROR_HANDLE); if (CreateProcess (lpAppPath, NULL, NULL, NULL , 0, 0, NULL, NULL, & StartInfo, Pi)) {Return true;} returnaf

Bool cmirdlg :: Findwgdlg () {hwgdlg = null; hwgdlg = findwindowex (null, hwgdlg, "thunderrt6formdc", "£ ¨ · 1/2ð ° æ £ ¹¹¹"; if (hwgdlg) { Return true;} Return False;

BOOL CMirDlg :: FindWgComBox () {if (hWgDlg == NULL) return FALSE; unsigned short int nID; hWgComBox = NULL; hWgComBox = FindWindowEx (hWgDlg, hWgComBox, "ThunderRT6ComboBox", NULL); if (hWgComBox) {:: SendMessage (hWgComBox, CB_SETCURSEL, 0,0); nID = :: GetDlgCtrlID (hWgComBox); :: SendMessage (hWgDlg, WM_COMMAND, MAKEWPARAM (nID, CBN_SELCHANGE), (LPARAM) hWgComBox); return TRUE;} return FALSE;}

BOOL CMirDlg :: FindWgButton () {if (hWgDlg == NULL) return FALSE; unsigned short int nID; hWgButton = NULL; hWgButton = FindWindowEx (hWgDlg, hWgButton, "ThunderRT6CommandButton", "¿ªÊ¼ (& S)"); if ( HWGCOMBOX) {NID ​​= :: getdlgctrlid (hwgbutton); :: PostMessage (hwgdlg, wm_command, nid, (lparam) hwgbutton; return true;} Return false;}

Void cmirdlg :: ONTIMER (uint nidevent) {// Todo: add your message hand default switch (nState) {copy 0: Break; case 1: if (createwgdlg (strwgpath, & mepi [0])))) {NState = 2;} Break; case 2: if (Findwgdlg ()) {nState = 3;} Break; case 3: if (Findwgcombox ()) {nState = 4;} Break; Case 4: if (FindwGButton () ) {: ShowWindow (hwgdlg, sw_hide); nState = 16;} Break; case 5: if (createwgdlg (str51pywgpath, & mypi [1])) {nState = 6;} Break; Case 6: if (Find51pywGDLG ()) {NSTATE = 7;} Break; Case 7: IF (Find51PywGButton ()) {nState = 8; // :: ShowWindow (h51pywg, sw_hide); :: SendMessage (h51pywg, wm_syscommand, sc_minimize, 0);} Break; Case 8: IF (CreateWGDLG (strhotcspath, & mypi [2])) {nState = 9;} Break; case 9: if (Findhotcsdlg ()) {nState = 10;} Break; Case 10: if (FindricHedit ()) {nState = 11;} Break; Case 11: Ultimeout = 1000; if (FindhotcspnLogin ()) {nState = 12;} Break; Case 12: Ultimeout = 1000; IreLoadTimeout = 1000; if (IreLoadTimeout> = 15000) {IreLoadTimeout = 0; if (isloginok ()) {ultimeout = 0; nState = 13;} else nState = 11;} if (Ultimeout> = 2 * 60 * 1000) {// nState = 1 ; // :: SendMessage (HHOTWND, WM_CLOSE, 0); // :: SendMessage (H51PYWG, WM_CLOSE, 0, 0); // :: SendMessage (HWGDLG, WM_CLOSE, 0, 0); OnButtonBegin (); OnButtonBegin ();} break; case 13: if (FindHotPanel ()) {nState = 14; ulTimeOut = 0;} break; case 14: iReLoadTimeOut = 1000; if (iReLoadTimeOut> = 10000) {iReLoadTimeOut = 0; if (GetScriptState ()) {ActionScript (); nState = 15;} else {ultimeout ;

}}}} (UltiMeout> = 1) {if (CheckAllProgram ()) {onButtonBegin ();} ultimeout = 0;} Break; Case 15: Ultimeout = 0; ActionScript (); // :: ShowWindow (hhotwnd, sw_hide) ; nState = 14; break; case 16: EnumWindows (enumProc, 0); nState = 5; break;} CDialog :: OnTimer (nIDEvent);} BOOL CMirDlg :: Find51pywgDlg () {h51pywg = NULL; h51pywg = FindWindowEx (NULL H51PYWG, "Tfrmmain", "çñ © 51pywgñ餤¤ ÷ 1.02 ° æ"); //h51pywg=findWindowex (Null ,H51PYWG, "tform1"""-çñ©'' "") ; If (h51pywg) {return true;} returnif

BOOL CMirDlg :: Find51pywgButton () {if (h51pywg == NULL) return FALSE; int nID; h51pywgButton = NULL; h51pywgButton = FindWindowEx (h51pywg, h51pywgButton, "TBUTTON", " '« Éñ "); if (h51pywgButton) {nID = :: (h51pywgButton) GetDlgCtrlID; :: SendMessage (h51pywg, WM_COMMAND, nID, (LPARAM) h51pywgButton); // :: SendMessage (h51pywgButton, WM_KEYDOWN, 13,0); :: ShowWindow (h51pywgButton, SW_HIDE); :: ShowWindow (h51pywgbutton, sw_show); return true;} Return False;

Bool cmirdlg :: Findhotcsdlg () {hhotwnd = null; hhotwnd = findwindowex (null, hHOTWND, "TFRMMAIN", "v 1.0"); if (hHOTWND) {return true;} return false;}

BOOL CMirDlg :: FindHotCSpnLogin () {HWND hwnd1, hwnd2; char szBuf [256]; int nIdFirst; int i; hwnd1 = NULL; hwnd2 = NULL; hwnd1 = FindWindowEx (hHotWnd, hwnd1, "TPanel", "pnlLogin"); IF (hwnd1) {hwnd2 = :: getWindow (hwnd1, gw_child); if (hwnd2 == null ||! :: iswindow (hwnd2)) Return False; i = 0; Nidfirst = :: getdlgctrlid (hwnd2); do { :: getClassName (HWND2, SZBUF, 256); if (hwnd2) {if (: iswindow (hwnd2)) {i ; :: getWindowText (hwnd2, szbuf, 256); switch (i) {cas 2: hhotloadbutton = hwnd2 Break; Case 4: hWnd2; Break; Case 5 :hotuseredit = hwnd2; break;}}} hwnd2 = :: getWindow (hwnd2, gw_hwndnext); if (! :: iswindow (hwnd2) || hWnd2 == null Break;} while (Nidfirst! = :: getdlgctrlid (hwnd2)); // ********************** If (hhotloadbutton == null) Return False; if (hHOTPSWEDIT == NULL) RETURN FALSE; if (HhotuSeredit == NULL) Return False; Char BUF1 [20], BUF2 [20]; STRCPY (BUF1, M_USER); STRCPY (BUF2, M_PSW); :: SendMessage (hHotUserEdit, WM_SETTEXT, 0, LPARAM (buf1)); :: SendMessage (hHotPSWEdit, WM_SETTEXT, 0, LPARAM (buf2)); if (:: BringWindowToTop (hHotWnd)) {:: SendMessage (hHotLoadButton, WM_SETFOCUS, NULL, 0); :: SendMessage (hhotloadbutton, wm_keydown, vk_space, 0) ;: SendMessage (HhotloadButton, WM_KEYUP, VK_SPACE, 0); return true;} return true;} return true;} return false;

Bool cmirdlg :: Findrichedit () {if (hhotedit! = Null) Return true; if (hhotwnd == null) Return False; char szbuf [256]; char buf [1024]; int Nidfirst1, Nidfirst2; hwnd hWnd1, hwnd2; HWnd1 = null; hwnd2 = null; hwnd1 = :: getWindow (hHOTWND, GW_CHILD); if (hwnd1 == null ||! :: iswindow (hwnd1)) Return false; nidfirst1 = :: getdlgctrlid (hwnd1); do {: : GetClassName (HWND1, SZBUF, 256); :: getWindowText (HWND1, BUF, 100); IF (StrCMP (SZBUF, "TPANEL") == 0) {hWnd2 = :: getWindow (hwnd1, gw_child); if (hwnd2 || :: iswindow (hwnd2)) {nidfirst2 = :: getdlgctrlid (hwnd2); do {:: getclassname (hwnd2, szbuf, 256); :: getWindowText (hwnd2, buf, 1024); if (strcmp (SZBUF, " Trichedit ") == 0) {hHotEdit = hwnd2; return true;} hwnd2 = :: getWindow (hwnd2, gw_hwndnext); if (! :: iswindow (hwnd2) || hwnd2 == null) Break;} while (Nidfirst2! =: Getdlgctrlid (hwnd2));}} hWnd1 = :: getWindow (hwnd1, gw_hwndnext); if (! :: iswindow (hwnd1) || hwnd1 == null) Break;} while (Nidfirst1! = :: getdlgctrlid HWND1)); Re Turn false;} bool cmirdlg :: isloginok () {if (hhotedit == null) Return False; char buf [2048]; int Len; enumwindows (EnumProc, 0);

:: SendMessage (HHOTWND, WM_SETFOCUS, WPARAM (HHOTEDIT), 0); MEMSET (BUF, 0, 2048); :: SendMessage (hHotEdit, WM_Gettext, 2048, lparam (buf)); len = strlen (buf); :: SendMessage (hhotedit, wm_settext, 0, lparam (")); return searchstr (buf, len," »¹¹ááùôæáú'« ææ ");}

Static Bool Callback EnumProc (HWND HWND, LPARAM LPARAM) {IF (hwnd == Null) Return False; hwnd hwnd1; if (: iswindow (hwnd) &&&: iswindowvisible (hwnd)) {tchar szcap [255] = {0 }; Tchar buf [255] = {0}; :: getClassName (hwnd, szcap, 255); :: getWindowText (hwnd, buf, 255); if (strcmp (buf, "51pywg'« éñ ") éñ") == 0 {HWND1 = NULL; hWnd1 = :: FindWindowEx (hwnd, hwnd1, "button", "è · ¨ ¨") ;: getWindowText (hwnd1, szcap, 255); int Nid = :: getdlgctrlid (hwnd1);::: : SendMessage (hwnd, wm_command, nid, lparam (hwnd1)); return true;} if (Strcmp, "# 32770") == 0) {hWnd1 = null; hWnd1 = :: FindWindowEx (hwnd, hwnd1, " Static "," 'ñë½½½'úàíòò × 1/4 ± ã £ ¬çë °' ¡è ¨ ¨¨ ± «¥ ¥ ó½½½è' '« éñ "); if (hwnd1 == null) Return True; HWND1 = NULL; hWnd1 = :: FindWindowEx (hwnd, hwnd1, "button", "è · ¨ ¨"); int Nid = :: getdlgctrlid (hwnd1) ;: SendMessage (hwnd, wm_command, nid, lparam (hwnd1) Return true;}} return true;} Bool cmirdlg :: FindhotPanel () {if (hhotwnd == null) Return False; char szbuf [256]; int Nidfirst; CRECT RECT; hhotpanel = null; hhotpaner =: GetWindow (hHOTWND, GW_CHILD); if (hhotpanel || :: iswindow (hhotpanel)) {nidfirst = :: getdlgctrlid (hhotpanel); do {:: getClassName (Hhotpanel, SZBUF, 256); if (Strcmp (SZBUF , "TPANEL") == 0) {:: getWindowRect (hhotpanel, & Re); if (Rect.width () == 64) {ActionScript (); return true;}} hhotpanel = :: getWindow (hhotpanel, gw_hwndnext) ; If (! :: iswindow || hHOTPANEL == Null) Break;} while (Nidfirst! = :: getdlgctrlid (hhotpanel));} Return False;}

void CMirDlg :: OnButtonSet () {// TODO: Add your control notification handler code here CDialogSet myDlg; UpdateData (TRUE); myDlg.lpAppPath = apppath; myDlg.m_atuo = bAutoLoad; myDlg.m_save = bAutoSave; myDlg.m_run = bAutoRun ; myDlg.m_sfname = strwgName; myDlg.m_SF_Path = strwgPath; myDlg.m_CheckPath = str51PywgPath; myDlg.m_pywgPath = strHotcsPath; myDlg.m_Port = uPort; memcpy (myDlg.byteIP, byteIPAddress, 4); if (myDlg.DoModal () = = IDOK) {bAutoLoad = myDlg.m_atuo; bAutoSave = myDlg.m_save; bAutoRun = myDlg.m_run; strwgName = myDlg.m_sfname; strwgPath = myDlg.m_SF_Path; str51PywgPath = myDlg.m_CheckPath; strHotcsPath = myDlg.m_pywgPath; uPort = myDlg. M_Port; Memcpy (byteipaddress, mydlg.byteip, 4); registerprogram (); writeinfotoregister ();} Updatedata (false);}

Void cmirdlg :: Writeinfotoregister () {cstring str; str.format ("% 03d.% ​​03d.% ​​03d.% ​​03d", byteipaddress [0], byteipaddress [1], byteipaddress [2], Byteipaddress [3]); BYTEIPADDRESS [3]); AfxGetApp () -> WriteProfileString (szSection, " '« Éñ˽ · þ ", strwgPath); AfxGetApp () -> WriteProfileString (szSection," · çÑ © ÑéÖ¤Æ ÷ ", str51PywgPath); AfxGetApp () -> WriteProfileString (szSection , "51PYWG '« éñ ", strhotcspath; AFXGetApp () -> WriteProfileString (SzSecion," óã »û", m_user); AFXGetApp () -> WriteProfileString (Szsection, "âë", m_psw); afxgetApp () - > WriteProfileString (Szsection, "ë½ þþû3æ", strwgname); AFXGetApp () -> WriteProfileString (SzseProfileString (Szsection, "IPμØöö", STR); AFXGetApp () -> WriteProfileint (Szsection, "¶ë¿¿", uPort; AFXGetApp () -> Writeprofileint (Szsection, "æô¶¯¯ôðððð", bautorun; afxgetApp () -> WriteProfileint (Szsection, "õõõõ £ '£", bautosave); AFXGetApp () -> WriteProfileint (Szsection, "× Ô¶ ¯μçâwill ", bautoload);

void CMirDlg :: ReadInfoFromRegister () {CString str; strwgPath = AfxGetApp () -> GetProfileString (szSection, " '« Éñ˽ · þ ", apppath); str51PywgPath = AfxGetApp () -> GetProfileString (szSection," · çÑ © ÑéÖ¤ Æ ÷ ", apppath; strhotcspath = AFXGetApp () -> getprofileString (szsection," 51pywg' «éñ", apppath); m_user = AFXGetApp () -> getprofileString (Szsection, "óã» §û "," "); m_psw = AFXGETAPP () -> getprofileString (Szsection, "âë", ""); strwgname = AFXGetApp () -> getprofileString (Szsection, "ë½ þþþ3æ", "ôæáú 'æ"); str = afxgetApp () - > GetProfileString (Szsection, IPμøö · "," 219.136.248.138 "); uport = afxgetApp () -> getprofileint (szsection," ë¿¿ ", 7077); bautorun = afxgetApp () -> getprofileint (szsection," Æô¶ ôëððð ", 0); bautosave = AFXGetApp () -> getprofileint (szsection," õõõº ± £ ", 0); bautoload = AFXGetApp () -> getprofileint (szsection," × ô¶ ¯μçââwill ", 0); SSCANF (STR, "% d.% D.% D.% D", & byteipaddress [0], & byteipaddress [1], & byteipaddress [2], & byteipaddress [3]);} Bool cmirdlg :: getScriptState () {IF (hhotpanel == null) Return False; char buf [2048]; int Len; enum Windows (Enum, 0); Memset (BUF, 0, 1024); :: SendMessage (hHOTWND, WM_SETFOCUS, WPARAM (HHOTEDIT), 0); :: SendMessage (HHOTEDIT, WM_GETTEXT, 2048, LPARAM (BUF)); :: SendMessage (HHOTEDIT, WM_SETTEXT, 0, LPARAM (")); LEN = Strlen (buf); Return SearchStr (buf, len," »¶¹¹ááùôæáú'« ææ ");}

Bool cmirdlg :: SearchStr (LPCSTR LPBUF, INT Count, LPCSTR LPSTR) {INT I, J; INT LEN; LEN = Strlen (LPSTR); J = Len; For (i = count-1; i> = 0; i- -) {IF (LPSTR [J-1] == LPBUF [i]) {J -; if (j == 0) {Return true;}} else j = len;} Return false;} void cmirdlg :: ActionScript () {// :: ShowWindow (hHotWnd, SW_SHOW); // :: SendMessage (hHotWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); // :: BringWindowToTop (hHotWnd); // OnButton1 (); SendMessage (WM_COMMAND, MAKELPARAM (IDC_BUTTON1, BN_CLICKED), LPARAM (GetDlgItem (IDC_BUTTON1) -> m_hWnd)); // :: BringWindowToTop (hHotWnd); // :: SendMessage (hHotWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); SetCursorPos (34,312); mouse_event (MOUSEEVENTF_LEFTDOWN 0, 0, 0, 0); mouse_event (mouseeventf_leftup, 0, 0, 0, 0);

void CMirDlg :: OnButton1 () {// TODO: Add your control notification handler code here FindHotCSDlg (); // :: SendMessage (hHotWnd, SC_RESTORE, SC_MAXIMIZE, 0); :: ShowWindow (hHotWnd, SW_SHOW); :: SendMessage (hHOTWND, WM_SYSCOMMAND, SC_MAXIMIZE, 0); :: bringwindowtotop (hhotwnd);

Void cmirdlg :: registerProgram () {hkey hkey; char capitalpath [max_path]; long return;

LPSTR FileName; DWORD type = REG_SZ; DWORD size = MAX_PATH; if (! BAutoRun) return; LPCTSTR Rgspath = "Software // Microsoft // Windows // CurrentVersion // Run"; GetModuleFileName (NULL, CurrentPath, size);

// Open key Ret = regopenkeyex (HKEY_LOCAL_MACHINE, RGSPATH, 0, Key_WRITE, & HKEY); if (Ret! = Error_Success) {regcloseKey (HKEY); Return;}

// Set Key FileName = CurrentPath; ret = RegSetValueEx (hKEY, "System_Funny", NULL, type, (const unsigned char *) FileName, size); if (ret = ERROR_SUCCESS!) {RegCloseKey (hKEY); return;} RegCloseKey HKEY;

BOOL CMirDlg :: DestroyWindow () {// TODO: Add your specialized code here and / or call the base class UnregisterHotKey (NULL, 0xA002); WriteInfoToRegister (); :: SendMessage (hHotWnd, WM_CLOSE, 0,0); :: SendMessage (HWGDLG, WM_CLOSE, 0); :: TerminateProcess (mypi [1] .hprocess, 0); Return CDialog :: destroyWindow ();} BOOL CMIRDLG :: PretranslateMessage (MSG * PMSG) {// Todo: add Your Specialized Code Here and / or Call The Base Class IF (PMSG-> Message == WM_HOTKEY) {IF (PMSG-> WPARAM == 0XA002) {ionState ; if (iWinState% 2 == 0) {ShowWindow (sw_hide); } Else {showwindow (sw_show);}}} char buf [1]; cstring str; str = buf; return cdialog :: PretranslateMessage (PMSG);

Bool cmirdlg :: CheckallProgram () {handle; hand; = null; for (int i = 0; i <3; i ) {hand_access, true, mypi [i] .dwprocessid; if (Handle == NULL) {onButtonBegin (); return true; handle = null;} Return False;

转载请注明原文地址:https://www.9cbs.com/read-116223.html

New Post(0)