给大家赠送一个我最近写的鼠标连点器的源代码!
給大家贈送一個我最近寫的鼠標連點器的源代碼!
歡迎大家關注我的微信號
源代碼下載地址
https://download.csdn.net/download/blackangelboy/10801071
程序界面如下圖:
貼出部分核心源代碼大家參照一下,這個小軟件我開發了三天 ^_^ 歷時15個小時開發完畢 ^_^ 大家喜歡就拿去參考參考,代碼不妥之處請別見怪,部分源代碼從網上搜集整合。因為是倉促開發,所以采用了暴力編程方式!超暴力編程呵呵^_^
LdianQIDlg.cpp源文件
// LdianQIDlg.cpp : implementation file
//
#include "stdafx.h"
#include "LdianQI.h"
#include "LdianQIDlg.h"
#include "DlgProxy.h"
#include "String.h"
#include <stdio.h>
//調用生成桌面快捷方式需要的頭文件函數
#include <windows.h>
#include <shlobj.h>
#pragma comment(lib, "shell32.lib")
//調用WAV聲音需要的頭文件函數
#include "Mmsystem.h"
#pragma comment(lib,"winmm.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern char StrKey;
extern char StrKeyStop;
extern CString Tmp;
extern CString TmpStop;
extern CString MouseOK;
extern CString MouseOKCombo;
extern CString MouseOKComboOK;
extern CString TimeGoodOK;
extern CString tempexe;
extern int ?NumTime;
extern CString URLFile;
extern int ?L_miao;
extern CString MouseCkool;
/
// CLdianQIDlg dialog
IMPLEMENT_DYNAMIC(CLdianQIDlg, CDialog);
CLdianQIDlg::CLdianQIDlg(CWnd* pParent /*=NULL*/)
?? ?: CDialog(CLdianQIDlg::IDD, pParent)
{
?? ?//{{AFX_DATA_INIT(CLdianQIDlg)
?? ?m_TXT = _T("");
?? ?//}}AFX_DATA_INIT
?? ?// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
?? ?m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
?? ?m_pAutoProxy = NULL;
}
CLdianQIDlg::~CLdianQIDlg()
{
?? ?// If there is an automation proxy for this dialog, set
?? ?// ?its back pointer to this dialog to NULL, so it knows
?? ?// ?the dialog has been deleted.
?? ?if (m_pAutoProxy != NULL)
?? ??? ?m_pAutoProxy->m_pDialog = NULL;
}
void CLdianQIDlg::DoDataExchange(CDataExchange* pDX)
{
?? ?CDialog::DoDataExchange(pDX);
?? ?//{{AFX_DATA_MAP(CLdianQIDlg)
?? ?DDX_Control(pDX, IDC_EDITTIMENUM, m_Tims);
?? ?DDX_Control(pDX, IDC_EDITTIMENUMTXT, m_TimeX);
?? ?DDX_Control(pDX, IDOK2, m_menuB);
?? ?DDX_Control(pDX, IDOK, m_menuA);
?? ?DDX_Control(pDX, IDC_SLIDER1, m_Slider);
?? ?DDX_Text(pDX, IDC_STATICX1, m_TXT);
?? ?DDX_Control(pDX, IDC_EXPLORER1, m_URLplay);
?? ?//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLdianQIDlg, CDialog)
?? ?//{{AFX_MSG_MAP(CLdianQIDlg)
?? ?ON_WM_PAINT()
?? ?ON_WM_QUERYDRAGICON()
?? ?ON_WM_CLOSE()
?? ?ON_WM_TIMER()
?? ?ON_WM_NCHITTEST()
?? ?ON_WM_HSCROLL()
?? ?ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER1, OnCustomdrawSlider1)
?? ?ON_WM_CTLCOLOR()
?? ?ON_BN_CLICKED(IDOK2, OnOk2)
?? ?ON_CBN_EDITUPDATE(IDC_COMBO1, OnEditupdateCombo1)
?? ?ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
?? ?ON_CBN_EDITUPDATE(IDC_COMBO3, OnEditupdateCombo3)
?? ?ON_CBN_SELCHANGE(IDC_COMBO3, OnSelchangeCombo3)
?? ?ON_CBN_EDITUPDATE(IDC_COMBO2, OnEditupdateCombo2)
?? ?ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2)
?? ?ON_CBN_EDITUPDATE(IDC_COMBO4, OnEditupdateCombo4)
?? ?ON_CBN_SELCHANGE(IDC_COMBO4, OnSelchangeCombo4)
?? ?ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
?? ?ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
?? ?ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
?? ?ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
?? ?ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
?? ?ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
?? ?ON_BN_CLICKED(IDC_BUTTON2, OnButtonQZ)
?? ?ON_BN_CLICKED(IDC_BUTTON3, OnButtonQZNO)
?? ?ON_BN_CLICKED(IDC_BUTTON4, OnButtonMINI)
?? ?ON_BN_CLICKED(IDC_BUTTON5, OnButtonJM)
?? ?//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/
// CLdianQIDlg message handlers
DWORD __stdcall ThreadProcKey(LPVOID lpParameter)?
{
CLdianQIDlg* Key = (CLdianQIDlg*)lpParameter;
?? ?while(1)
?? ??? ?{
?? ??? ??? ?Sleep(50);?? ??? ?
?? ??? ??? ?Key->GetDlgItem(IDC_COMBO1)->GetWindowText(Tmp);?
?? ??? ??? ?CString TmpX;
?? ??? ??? ?Key->GetDlgItem(IDC_COMBO2)->GetWindowText(TmpX);?
?? ??? ??? ??? ??? ?if(Tmp!="")
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?Key->RegKeyCe();//執行熱鍵0-9 A-Z檢測
?? ??? ??? ??? ??? ??? ?if(TmpX=="CTRL" || TmpX=="ctrl" )
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_CONTROL,StrKey);
? ? ? ? ? ? ? ? ? ? ? ? //AfxMessageBox("熱鍵為CTRL");?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpX=="ALT" || TmpX=="alt" )
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_ALT,StrKey);
?? ??? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵為ALT");?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpX=="SHIFT" || TmpX=="shift")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_SHIFT,StrKey);
?? ??? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵為SHIFT");?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?//RegisterHotKey(NULL,0x00090003,MOD_CONTROL,TEXT(StrKey));
?? ??? ??? ??? ??? ??? ?//注冊熱鍵 MOD_ALT ;MOD_CONTROL ;MOD_SHIFT ;MOD_WIN?
?? ??? ??? ??? ??? ??? ?//RegisterHotKey(GetSafeHwnd(), ?HOTKEYID, MOD_CONTROL, TEXT('L'))
?? ??? ??? ??? ??? ??? ?MSG msg;
?? ??? ??? ??? ??? ??? ?while(GetMessage(&msg,NULL,0,0))//從消息隊伍獲取消息
?? ??? ??? ??? ??? ??? ??? ?{
? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?if(msg.message==WM_HOTKEY)//熱鍵消息
?? ??? ??? ??? ??? ??? ??? ??? ??? ?{?? ??? ??? ?
?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵"+TmpX+" + "+Tmp+"已設置成功!開啟執行");?
?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?MouseOK="開始鼠標點擊";
?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?MouseCkool="連續點擊鼠標左鍵";
?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?goto lbit;
?? ??? ??? ??? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?lbit:
?? ??? ??? ??? ??? ??? ?;
?? ??? ??? ??? ??? ??? ?UnregisterHotKey(NULL,0x00000003);//卸載掉注冊的熱鍵
?? ??? ??? ??? ??? ?}
?? ??? ?}
? ? return 0;
}
DWORD __stdcall ThreadProcKeyStop(LPVOID lpParameter)?
{
CLdianQIDlg* KeyStop = (CLdianQIDlg*)lpParameter;
?? ?while(1)
?? ??? ?{
?? ??? ??? ?Sleep(50);?? ??? ?
?? ??? ??? ?KeyStop->GetDlgItem(IDC_COMBO3)->GetWindowText(TmpStop);?
?? ??? ??? ?CString TmpXStop;
?? ??? ??? ?KeyStop->GetDlgItem(IDC_COMBO4)->GetWindowText(TmpXStop);?
?? ??? ??? ?if(Tmp!="")
?? ??? ??? ?{
?? ??? ??? ??? ?KeyStop->RegKeyCeStop();//執行熱鍵0-9 A-Z檢測
?? ??? ??? ??? ?if(TmpXStop=="CTRL" || TmpXStop=="ctrl" )
?? ??? ??? ??? ?{
?? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_CONTROL,StrKeyStop);
? ? ? ? ? ? ? ? //AfxMessageBox("熱鍵為CTRL");?
?? ??? ??? ??? ?}
?? ??? ??? ??? ?if(TmpXStop=="ALT" || TmpXStop=="alt" )
?? ??? ??? ??? ?{
?? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_ALT,StrKeyStop);
?? ??? ??? ??? ?//AfxMessageBox("熱鍵為ALT");?
?? ??? ??? ??? ?}
?? ??? ??? ??? ?if(TmpXStop=="SHIFT" || TmpXStop=="shift")
?? ??? ??? ??? ?{
?? ??? ??? ??? ?RegisterHotKey(NULL,0x00000003,MOD_SHIFT,StrKeyStop);
?? ??? ??? ??? ?//AfxMessageBox("熱鍵為SHIFT");?
?? ??? ??? ??? ?}
?? ??? ??? ??? ?//RegisterHotKey(NULL,0x00090003,MOD_CONTROL,TEXT(StrKey));
?? ??? ??? ??? ?//注冊熱鍵 MOD_ALT ;MOD_CONTROL ;MOD_SHIFT ;MOD_WIN?
?? ??? ??? ??? ?//RegisterHotKey(GetSafeHwnd(), ?HOTKEYID, MOD_CONTROL, TEXT('L'))
?? ??? ??? ??? ?MSG msg;
?? ??? ??? ??? ?while(GetMessage(&msg,NULL,0,0))//從消息隊伍獲取消息
?? ??? ??? ??? ??? ?{
? ??? ??? ??? ??? ??? ??? ??? ?if(msg.message==WM_HOTKEY)//熱鍵消息
?? ??? ??? ??? ??? ??? ??? ?{?? ??? ??? ?
?? ??? ??? ??? ??? ??? ??? ??? ?KeyStop->KeyOkStop();
?? ??? ??? ??? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵"+TmpXStop+" + "+TmpStop+"已設置成功!關閉執行");?
?? ??? ??? ??? ??? ??? ??? ??? ?goto lbitStop;
?? ??? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?lbitStop:
?? ??? ??? ??? ?;
?? ??? ??? ??? ?UnregisterHotKey(NULL,0x00000004);//卸載掉注冊的熱鍵
?? ??? ??? ?}
?? ??? ?}
? ? return 0;
}
DWORD __stdcall ThreadProcMuseOK(LPVOID lpParameter)?
{
CLdianQIDlg* MuseOK = (CLdianQIDlg*)lpParameter;
?? ?while(1)
?? ??? ?{
?? ??? ??? ?if(MouseOK=="開始鼠標點擊")
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ? ?MuseOK->KeyOk();
?? ??? ??? ??? ?}
?? ??? ??? ?if(MouseOKCombo=="啟用鼠標快捷鍵")
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ? ?MuseOK->KeyMouse();
?? ??? ??? ??? ?}
?? ??? ??? ?else if(MouseOKCombo=="暫停鼠標熱鍵" || MouseOKComboOK=="暫停鼠標熱鍵")
?? ??? ??? ??? ??? ??? ?{
? ? ? ? ? ? ? ? ? ? ? ? ? ? Sleep(10);
?? ??? ??? ??? ??? ??? ??? ?if(KEY_DOWN(MOUSE_MOVED))
?? ??? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標左鍵!觸發鼠標自動操作!");
?? ??? ??? ??? ??? ??? ??? ??? ?MouseOKComboOK="開啟鼠標熱鍵動作";
?? ??? ??? ??? ??? ??? ??? ??? ?MouseOKCombo="啟用鼠標快捷鍵";
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?}
?? ??? ?}
? ? return 0;
}
DWORD __stdcall ThreadProcTime(LPVOID lpParameter)?
{
CLdianQIDlg* TimeDig = (CLdianQIDlg*)lpParameter;
?? ?while(1)
?? ??? ?{
?? ??? ??? ?TimeDig->WindowsNumTime();//執行計時功能函數
?? ??? ?}
? ? return 0;
}
//以下代碼為生成桌面快捷方式-----------------------------------------------------------------------
BOOL CLdianQIDlg::GetDesktopPath(char *pszDesktopPath)
{
?? ?LPITEMIDLIST ?ppidl = NULL;?
?? ?
?? ?if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &ppidl) == S_OK)
?? ?{
?? ??? ?BOOL flag =?? ?SHGetPathFromIDList(ppidl, pszDesktopPath);
?? ??? ?CoTaskMemFree(ppidl);
?? ??? ?return flag;
?? ?}
?
?? ?return FALSE;
}
BOOL CLdianQIDlg::GetIEQuickLaunchPath(char *pszIEQueickLaunchPath)
{?? ?
?? ?LPITEMIDLIST ?ppidl; ?? ??? ??? ?
?? ?
?? ?if (SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &ppidl) == S_OK)
?? ?{
?? ??? ?BOOL flag =?? ?SHGetPathFromIDList(ppidl, pszIEQueickLaunchPath);
?? ??? ?strcat(pszIEQueickLaunchPath, "\\Microsoft\\Internet Explorer\\Quick Launch");
?? ??? ?CoTaskMemFree(ppidl);
?? ??? ?return flag;
?? ?}
?
?? ?return FALSE;
}
BOOL CLdianQIDlg::GetProgramsPath(char *pszProgramsPath)
{
?? ?LPITEMIDLIST ?ppidl;?
?? ?
?? ?if (SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &ppidl) == S_OK)
?? ?{
?? ??? ?BOOL flag = SHGetPathFromIDList(ppidl, pszProgramsPath);
?? ??? ?CoTaskMemFree(ppidl);
?? ??? ?return flag;
?? ?}
?
?? ?return FALSE;
}
/*
函數功能:對指定文件在指定的目錄下創建其快捷方式
函數參數:
lpszFileName ? ?指定文件,為NULL表示當前進程的EXE文件。
lpszLnkFileDir ?指定目錄,不能為NULL。
lpszLnkFileName 快捷方式名稱,為NULL表示EXE文件名。
wHotkey ? ? ? ? 為0表示不設置快捷鍵
pszDescription ?備注
iShowCmd ? ? ? ?運行方式,默認為常規窗口
*/
BOOL CreateFileShortcut(LPCSTR lpszFileName, LPCSTR lpszLnkFileDir, LPCSTR lpszLnkFileName,?? ?
LPCSTR lpszWorkDir, WORD wHotkey, LPCTSTR lpszDescription, int iShowCmd = SW_SHOWNORMAL)
{
?? ?if (lpszLnkFileDir == NULL)
?? ??? ?return FALSE;
?
?? ?HRESULT hr;
?? ?IShellLink ? ? *pLink; ?//IShellLink對象指針
?? ?IPersistFile ? *ppf; //IPersisFil對象指針
?? ?
?? ?//創建IShellLink對象
?? ?hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,?
(void**)&pLink);
?? ?if (FAILED(hr))
?? ??? ?return FALSE;
?? ?
?? ?//從IShellLink對象中獲取IPersistFile接口
?? ?hr = pLink->QueryInterface(IID_IPersistFile, (void**)&ppf);
?? ?if (FAILED(hr))
?? ?{
?? ??? ?pLink->Release();
?? ??? ?return FALSE;
?? ?}
?? ?
?? ?//目標
?? ?if (lpszFileName == NULL)
?? ??? ?pLink->SetPath(_pgmptr);
?? ?else
?? ??? ?pLink->SetPath(lpszFileName);
?? ?
?? ?//工作目錄
?? ?if (lpszWorkDir != NULL)
?? ??? ?pLink->SetPath(lpszWorkDir);
?? ?
?? ?//快捷鍵
?? ?if (wHotkey != 0)
?? ??? ?pLink->SetHotkey(wHotkey);
?? ?
?? ?//備注
?? ?if (lpszDescription != NULL)
?? ??? ?pLink->SetDescription(lpszDescription);
?? ?
?? ?//顯示方式
?? ?pLink->SetShowCmd(iShowCmd);
?
?
?? ?//快捷方式的路徑 + 名稱
?? ?char szBuffer[MAX_PATH];
?? ?if (lpszLnkFileName != NULL) //指定了快捷方式的名稱
?? ??? ?sprintf(szBuffer, "%s\\%s", lpszLnkFileDir, lpszLnkFileName);
?? ?else ??
?? ?{
?? ??? ?//沒有指定名稱,就從取指定文件的文件名作為快捷方式名稱。
?? ??? ?char *pstr;
?? ??? ?if (lpszFileName != NULL)
?? ??? ??? ?pstr = strrchr(lpszFileName, '\\');
?? ??? ?else
?? ??? ??? ?pstr = strrchr(_pgmptr, '\\');
?
?? ??? ?if (pstr == NULL)
?? ??? ?{?? ?
?? ??? ??? ?ppf->Release();
?? ??? ??? ?pLink->Release();
?? ??? ??? ?return FALSE;
?? ??? ?}
?? ??? ?//注意后綴名要從.exe改為.lnk
?? ??? ?sprintf(szBuffer, "%s\\%s", lpszLnkFileDir, pstr);
?? ??? ?int nLen = strlen(szBuffer);
?? ??? ?szBuffer[nLen - 3] = 'l';
?? ??? ?szBuffer[nLen - 2] = 'n';
?? ??? ?szBuffer[nLen - 1] = 'k';
?? ?}
?? ?//保存快捷方式到指定目錄下
?? ?WCHAR ?wsz[MAX_PATH]; ?//定義Unicode字符串
?? ?MultiByteToWideChar(CP_ACP, 0, szBuffer, -1, wsz, MAX_PATH);
?? ?
?? ?hr = ppf->Save(wsz, TRUE);
?? ?
?? ?ppf->Release();
?? ?pLink->Release();
?? ?return SUCCEEDED(hr);
}
//以上代碼為生成桌面快捷方式-----------------------------------------------------------------------
BOOL CLdianQIDlg::OnInitDialog()
{
?? ?CDialog::OnInitDialog();
?? ?// Set the icon for this dialog. ?The framework does this automatically
?? ?// ?when 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
?? ?
?? ?// TODO: Add extra initialization here
?? ?CenterWindow();//程序啟動時窗體處于屏幕的中心位置
?? ?{//檢測是否開啟了打開了相同程序
?? ??? ??? ?HWND ?wnd;
?? ??? ??? ?wnd=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ??? ?if(wnd!=NULL)
?? ??? ??? ?{
?? ??? ??? ??? ?//::ShowWindow(wnd,SW_HIDE);//將窗口隱藏
?? ??? ??? ??? ?MessageBox("為了不至于您的計算機鼠標精神錯亂!^_^\r\n\r\n所以每次只允許開啟一個鼠標連點器!","程序開啟出錯提示",MB_OK|MB_ICONINFORMATION);
?? ??? ??? ??? ?//CDialog::OnClose();
?? ??? ??? ??? ?KAI="程序已經開啟";
?? ??? ??? ??? ?SetTimer(2,10,NULL);
?? ??? ??? ??? ?//return TRUE; ?// return TRUE unless you set the focus to a control
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?SetWindowText("鼠標連點器——海馬軟件QQ:9254793");?? ?//設置窗體標題
?? ??? ??? ?}
?? ?}
?? ?對文件地址的"\"替換成"\\"
?? ?for(int i=0;i<tempexe.GetLength();i++)
?? ?{
?? ? ?int index = tempexe.Find("\\");
?? ? ?if(index == -1)
?? ??? ? continue;
?? ??? ? ?else
?? ??? ? ?{
?? ??? ??? ? ?if(i==1)
?? ??? ??? ? ?{
?? ??? ??? ??? ?tempexe.Replace("\\","\\\\\\\\"); //前面的參數是要替換的字符串,后面的參數是你指定的新字符串
?? ??? ??? ? ?}
?? ??? ??? ? ?if(i>1)
?? ??? ??? ? ?{
?? ??? ??? ??? ? ?goto lid;
?? ??? ??? ? ?}
?? ??? ??? ? ?//MessageBox(tempexe,"程序地址2",MB_OK|MB_ICONINFORMATION);
?? ??? ??? ? ?GetDlgItem(IDC_STATICFILE)->SetWindowText(tempexe);?
?? ??? ? ?} ?
?? ?}
?? ?lid:
?? ?;
? ? CString StrFileOk;
? ? GetDlgItem(IDC_STATICFILE)->GetWindowText(StrFileOk);?
?? ?//MessageBox(StrFileOk,"程序地址3",MB_OK|MB_ICONINFORMATION);
?? ?char *filepath;
?? ?filepath=(LPSTR)(LPCTSTR)StrFileOk;//強制轉換
?? ?//方法一 獲取程序的大小
?? ?HANDLE handle = CreateFile(filepath, FILE_READ_EA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
?? ?if (handle != INVALID_HANDLE_VALUE)
?? ?{
?? ??? ?int size = GetFileSize(handle,NULL);
?? ??? ?CString TXNUM;
?? ??? ?TXNUM.Format(_T("%d"),size);
?? ??? ?//MessageBox("程序大小為:"+TXNUM+"字節","程序大小",MB_OK|MB_ICONINFORMATION);
?? ??? ?CloseHandle(handle);
?? ??? ?int ExeNum=atoi(TXNUM);
?? ??? ?if(ExeNum==2667008 ?|| ExeNum==2670592)
?? ??? ?{
? ? ? ? ? ? //MessageBox("程序原始大小為 2667008 字節\r\n經過軟件自身安全檢測!\r\n此程序未被其他軟件修改!\r\n可以放心使用^_^!","程序安全檢測",MB_OK|MB_ICONINFORMATION);
?? ??? ??? ?
?? ??? ??? ?//使用已經添加的快捷方式生成函數添加程序的桌面快捷方式
?? ??? ??? ?{
?? ??? ??? ??? ?char ?szPath[MAX_PATH];
?? ??? ??? ??? ?CoInitialize(NULL);?
?? ??? ??? ??? ?GetDesktopPath(szPath);
?? ??? ??? ??? ?//if(CreateFileShortcut(NULL, szPath, NULL, NULL, MAKEWORD(VK_F12, HOTKEYF_CONTROL), "海馬軟件榮譽出品:QQ:9254793"));
?? ??? ??? ??? ?if(CreateFileShortcut(NULL, szPath, "海馬鼠標連點器.lnk", NULL, MAKEWORD(VK_F12, HOTKEYF_CONTROL), "海馬軟件榮譽出品:QQ:9254793 \r\n海馬軟件唯一官方微信:MxpSoft\r\n海馬軟件自帶安全檢測機制可以保障軟件不會被第三方篡改!" ));
?? ??? ??? ??? ?//printf("創建成功\n");?
?? ??? ??? ??? ?CoUninitialize();
?? ??? ??? ?}?? ??? ?
?? ??? ?}
?? ??? ?else
?? ??? ?{
? ? ? ? ? ? MessageBox("本軟件內嵌程序安全檢測功能\r\n經過程序對自身數據文件的安全檢測!\r\n發現當前您使用的程序可能被非法軟件惡意修改過了!\r\n原版的程序實際大小為: 2667008 字節!\r\n本軟件發現自己被別人非法篡改了!\r\n為了保證用戶的計算機安全!\r\n軟件自動啟動自殺功能!\r\n請立即刪除此軟件!\r\n重新從官方網站下載官方版!\r\n程序開始自動執行自身刪除功能!\r\n請從官方網站下載免費正版!\r\n\r\n\r\n\r\n程序雖小!但也原創!\r\n拒絕捆綁!自殺無罪!\r\n尊重原創!請勿綁我!\r\n珍惜生命!請勿盜我!\r\n\r\n(X_X) ?(X_X) ?(X_X)\r\n\r\n(X_X) ?(X_X) ?(X_X)\r\n\r\n程序自我鑒定已經被垃圾軟件非法捆綁!\r\n開始進行自殺卸載!都別攔我!!!~~~~~~~~~~~~~~~","程序安全檢測",MB_OK|MB_ICONINFORMATION);
?? ??? ??? ?DelSoft();//執行軟件自動清除功能!
?? ??? ?}
?? ?}
?? ?//配合定時器設置程序窗體打開特效
?? ?//獲得窗口預設的大小
?? ?CRect dlgRect;
?? ?GetWindowRect(dlgRect);
?? ?CRect desktopRect;
?? ?//將窗口開始大小設為0
?? ?GetDesktopWindow()->GetWindowRect(desktopRect);
?? ?MoveWindow((desktopRect.Width() - dlgRect.Width()) / 2,
?? ??? ??? ? ? (desktopRect.Height() - dlgRect.Height()) / 2,
?? ??? ??? ? ? 0,
?? ??? ??? ? ? 0 );
?? ?//初始化變化大小
?? ?m_nWidth=dlgRect.Width();
?? ?m_nHeight=dlgRect.Height();
?? ?m_nDx=2;
?? ?m_nDy=4;
?? ?m_nDx1=2;
?? ?m_nDy1=2;
?? ?//設定定時器1?? ?
?? ?SetTimer(1,1,NULL);
? ? OpenBn();
/*
? ? //設置窗口半透明
?? ?//設置窗口擴展風格
?? ?SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(GetSafeHwnd(),GWL_EXSTYLE)|0x80000);?? ?
?? ?typedef BOOL (WINAPI *FSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
?? ?FSetLayeredWindowAttributes SetLayeredWindowAttributes ;
?? ?HINSTANCE hInst = LoadLibrary("User32.DLL");
?? ?SetLayeredWindowAttributes = (FSetLayeredWindowAttributes)GetProcAddress(hInst,"SetLayeredWindowAttributes");
?? ?if (SetLayeredWindowAttributes)
?? ??? ?SetLayeredWindowAttributes(GetSafeHwnd(),RGB(0,0,0),128,2);
?? ?FreeLibrary(hInst);
*/
?? ?/*//實現定制回車鍵 此方法暫不使用
?? ?m_hAccel = ::LoadAccelerators(AfxGetResourceHandle(),
?? ?m_lpszTemplateName); // use same resource name as dialog
?? ?//ASSERT(m_hAccel);
?? ?*/
? ? UpdateData(TRUE);
?? ?Num=10;
?? ?m_Slider.SetRange(0,100);//設置范圍
?? ?m_Slider.SetTicFreq(1);//設置顯示刻度的間隔
?? ?m_Slider.SetPos(90);//當前停留的位置
?? ?m_Slider.SetLineSize(10);//一行的大小,對應鍵盤的方向鍵
?? ?UpdateData(FALSE);
?? ?
?? ??? ?m_menuA.SetBitmap(LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAPA))); //設置按鈕圖標
?? ??? ?m_menuB.SetBitmap(LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAPB))); //設置按鈕圖標
? ? GetDlgItem(IDC_COMBO1)->SetWindowText("1");?
?? ?GetDlgItem(IDC_COMBO2)->SetWindowText("CTRL");?
?? ?GetDlgItem(IDC_COMBO3)->SetWindowText("2");?
?? ?GetDlgItem(IDC_COMBO4)->SetWindowText("CTRL");?
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadMuseOK,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadTime,0);//關閉舊的多線程
?? ?m_hThreadKey ? ? ? ? = CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?m_hThreadKeyStop ? ? = CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?m_hThreadMuseOK ? ? ?= CreateThread(NULL,0,ThreadProcMuseOK,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?m_hThreadTime ? ? ? ?= CreateThread(NULL,0,ThreadProcTime,this,0,NULL);//開啟多線程生產數據綜合查詢功能
? ? ::SetWindowPos(m_URLplay,HWND_TOPMOST,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);//將控件窗口在最前端顯示
?? ?{
?? ??? ?
?? ??? ??? ?CString Ustr="http://w1.zhexi.tech:14534/app/";
?? ??? ??? ?//CString Ustr="http://w1.zhexi.tech:14534/app/";
?? ??? ??? ?//CFileDialog log(TRUE,"文件",Ustr,OFN_HIDEREADONLY,"FILE(*.htm)|*.htm||",NULL);
?? ??? ??? ?//CString pathURL=log.GetPathName();
?? ??? ??? ?//m_URLplay.ScrollBarsEnabled=false;//去掉WebBrowser本身自帶的滾動條
?? ??? ??? ?//m_URLplay.Document.Body.SetAttribute("style","overflow:hidden")
?? ??? ??? ?m_URLplay.Navigate2(COleVariant(Ustr),NULL,NULL,NULL,NULL);
?? ??? ??? ?//MessageBox("調用的程序背景地址為:"+StrLie1);
?? ??? ??? ?//MessageBox(Ustr);
?? ?}
?? ?return TRUE; ?// return TRUE ?unless you set the focus to a control
}
// 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 CLdianQIDlg::OnPaint()?
{
?? ? ?//設置圖片背景代碼
?? ??? ?CPaintDC dc(this);
?? ??? ?CRect r;
?? ??? ?GetClientRect(&r);
?? ??? ?CDC memdc;
?? ??? ?memdc.CreateCompatibleDC(&dc);
?? ??? ?BITMAP bitStruct;
?? ??? ?CBitmap bitmap;
?? ??? ?bitmap.LoadBitmap(IDB_BITMAP);
?? ??? ?bitmap.GetBitmap(&bitStruct);
?? ??? ?memdc.SelectObject(&bitmap);
?? ??? ?dc.StretchBlt(0,0,r.Width(),r.Height(),&memdc,0,0,bitStruct.bmWidth,bitStruct.bmHeight,SRCCOPY);
?? ??? ?//設置背景透明效果
?? ??? ?dc.SetBkMode(TRANSPARENT);
?? ??? ?memdc.DeleteDC();
?? ??? ?bitmap.DeleteObject();
? /*
?? ?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();
?? ?}
? */
}
BEGIN_EVENTSINK_MAP(CLdianQIDlg, CDialog)
? ? //{{AFX_EVENTSINK_MAP(CLdianQIDlg)
?? ?//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
// The system calls this to obtain the cursor to display while the user drags
// ?the minimized window.
HCURSOR CLdianQIDlg::OnQueryDragIcon()
{
?? ?return (HCURSOR) m_hIcon;
}
// Automation servers should not exit when a user closes the UI
// ?if a controller still holds on to one of its objects. ?These
// ?message handlers make sure that if the proxy is still in use,
// ?then the UI is hidden but the dialog remains around if it
// ?is dismissed.
BOOL CLdianQIDlg::CanExit()
{
?? ?// If the proxy object is still around, then the automation
?? ?// ?controller is still holding on to this application. ?Leave
?? ?// ?the dialog around, but hide its UI.
?? ?if (m_pAutoProxy != NULL)
?? ?{
?? ??? ?ShowWindow(SW_HIDE);
?? ??? ?return FALSE;
?? ?}
?? ?return TRUE;
}
void CLdianQIDlg::OnTimer(UINT nIDEvent)?
{?? ?
?? ?//獲得此時窗口的實際大小
?? ?CRect dlgRect;
?? ?GetWindowRect(dlgRect);
?? ?//獲得桌面的大小
?? ?CRect desktopRect;
?? ?GetDesktopWindow()->GetWindowRect(desktopRect);
?? ?//如果是窗口彈出過程,則逐漸增大窗口
?? ?if(nIDEvent == 1)
?? ?{ ? ? ? ?
?? ??? ?MoveWindow(
?? ??? ??? ??? ? ?(-m_nDx+desktopRect.Width() - dlgRect.Width()) / 2,
?? ??? ??? ??? ? ?(-m_nDy+desktopRect.Height() - dlgRect.Height()) / 2,?
?? ??? ??? ??? ? ?+m_nDx+dlgRect.Width(),
?? ??? ??? ??? ? ?+m_nDy+dlgRect.Height() );
?? ??? ?
?? ??? ?//不要超過窗口預設的寬度
?? ??? ?if(dlgRect.Width() >=m_nWidth)?
?? ??? ??? ?m_nDx=0;?
?? ??? ?//不要超過窗口預設的高度
?? ??? ?if(dlgRect.Height() >=m_nHeight)
?? ??? ??? ?m_nDy=0;
?? ??? ?//停止變化,關閉定時器1
?? ??? ?if((dlgRect.Width() >=m_nWidth) && (dlgRect.Height() >=m_nHeight))
?? ??? ??? ?KillTimer(1);?
?? ?}
?? ?
?? ?//停止變化,關閉定時器1
?? ?if((dlgRect.Width() >=m_nWidth) && (dlgRect.Height() >=m_nHeight))
?? ??? ?KillTimer(1);?
?? ?
?? ?//如果是窗口關閉過程,則逐漸縮小窗口
?? ?if(nIDEvent == 2 || KAI=="程序已經開啟")
?? ?{
?? ??? ?MoveWindow((+m_nDx+desktopRect.Width() - dlgRect.Width()) / 2,
?? ??? ??? ?(+m_nDy+desktopRect.Height() - dlgRect.Height()) / 2,
?? ??? ??? ?-m_nDx1+dlgRect.Width(),
?? ??? ??? ?-m_nDy1+dlgRect.Height() );
?? ??? ?
?? ??? ?//當寬度等于零后寬度就不在變化
?? ??? ?if(dlgRect.Width() <= 0)?
?? ??? ??? ?m_nDx1=0;
?? ??? ?//當高度等于零后高度就不在變化
?? ??? ?if(dlgRect.Height() <= 0 )
?? ??? ??? ?m_nDy1=0;?
?? ??? ?//停止變化,關閉定時器2,并且關閉窗口
?? ??? ?if((dlgRect.Width() <= 0 ) && (dlgRect.Height() <=0))
?? ??? ?{
?? ??? ??? ?KillTimer(2);
?? ??? ??? ?CDialog::OnOK();
?? ??? ?}?? ??? ?
?? ?}?? ?
?? ?CDialog::OnTimer(nIDEvent);
}
//按確定按鈕
void CLdianQIDlg::OnOK()?
{
?? ?if(MessageBox("確定要退出海馬鼠標自動連點器嗎?","退出海馬鼠標連點器提示",
?? ?MB_OKCANCEL|MB_ICONQUESTION)!=IDOK)
?? ?return;
?? ?//設定關閉時的定時器2
?? ?SetTimer(2,10,NULL);?? ?
?? ?//CDialog::OnOK();
}
//按取消按鈕
void CLdianQIDlg::OnCancel()?
{
?? ?if(MessageBox("確定要退出海馬鼠標自動連點器嗎?","退出海馬鼠標連點器提示",
?? ?MB_OKCANCEL|MB_ICONQUESTION)!=IDOK)
?? ?return;
?? ?//設定關閉時的定時器2
?? ?SetTimer(2,10,NULL);
?? ?//CDialog::OnCancel();
}
//按系統關閉按鈕
void CLdianQIDlg::OnClose()?
{
?? ?if(MessageBox("確定要退出海馬鼠標自動連點器嗎?","退出海馬鼠標連點器提示",
?? ?MB_OKCANCEL|MB_ICONQUESTION)!=IDOK)
?? ?return;
?? ?//設定關閉時的定時器2
?? ?SetTimer(2,10,NULL);
? ? CDialog::OnClose();
}
UINT CLdianQIDlg::OnNcHitTest(CPoint point)?
{
?? ?//以下此段是實現用鼠標點住窗口任何位置即可移動窗體的功能代碼共兩行
?? ?UINT nHitTest = CDialog::OnNcHitTest(point); ? //實現用鼠標點住窗口任何位置即可移動窗體的功能
?? ?return(nHitTest==HTCLIENT)?HTCAPTION:nHitTest; //實現用鼠標點住窗口任何位置即可移動窗體的功能
}
BOOL CLdianQIDlg::PreTranslateMessage(MSG* pMsg)?
{
?? ?//以下代碼實現完全屏蔽回車退出程序
?? ?if(pMsg->message==WM_KEYDOWN&&pMsg->wParam==VK_RETURN) ? ?
? ? ? ? ? ? return TRUE;?
? ? ? ? ?if(pMsg->message==WM_KEYDOWN&&pMsg->wParam==VK_ESCAPE) ? ?
? ? ? ? ? ? return TRUE;?
?? ?/*//此代碼有些問題暫不使用
?? ?if(pMsg->wParam==27)//檢測到按ESC鍵執行回車
?? ??? ?{
?? ??? ??? ??? ?pMsg->wParam=11;
?? ??? ?}
?? ?if (WM_KEYFIRST <= pMsg->message && pMsg->message <= WM_KEYLAST) {
?? ??? ?HACCEL hAccel = m_hAccel;
?? ??? ?if (hAccel && ::TranslateAccelerator(m_hWnd, hAccel, pMsg))
?? ??? ??? ?return TRUE;
?? ?}
?? ?*/
?? ?
?? ?/*//以下代碼實現屏蔽ESC退出程序同時指定回車鍵到指定控件中
?? ?if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN ) ? ??
?? ??? ??? ? {
?? ??? ??? ??? ? if(GetFocus()->GetDlgCtrlID()==IDC_MSG_SEND)//
?? ??? ??? ? }
? ? */
?? ?return CDialog::PreTranslateMessage(pMsg);
}
void CLdianQIDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)?
{
?? ?// TODO: 在此添加消息處理程序代碼和/或調用默認值
?? ?CSliderCtrl* slider=(CSliderCtrl*)pScrollBar;
?? ?if (slider=&m_Slider)
?? ?{
?? ??? ?UpdateData(TRUE);
?? ??? ?Num=m_Slider.GetPos();
?? ??? ?// 將滑塊數值填寫入指定控件中?? ?
?? ??? ?CString temp;?
?? ??? ?temp.Format("%d",Num);
?? ??? ?GetDlgItem(IDC_STATICX1)->SetWindowText(temp+"%");?
?? ??? ?OpenBn();
?? ??? ?//實現及時刷新窗口
?? ??? ?HWND ?hwnd;
?? ??? ?hwnd=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ?if(hwnd!=NULL)
?? ??? ?{
?? ??? ??? ?::InvalidateRect(hwnd, NULL, true);
?? ??? ??? ?::UpdateWindow(hwnd);
?? ??? ??? ?m_URLplay.Invalidate();
?? ??? ??? ?::SetWindowPos(m_URLplay,HWND_TOPMOST,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);//將控件窗口在最前端顯示
?? ??? ??? ?Invalidate();
?? ??? ?}
?? ??? ?UpdateData(FALSE);
?? ?}
}
void CLdianQIDlg::OnCustomdrawSlider1(NMHDR* pNMHDR, LRESULT* pResult) //在滑塊上增加 OnCustomdrawSlider1 ?事件
{
?? ?//在此函數中使用此方法會導致程序一些問題 所以此函數暫時不用
?? ?/*
? ? UpdateData(TRUE);
? ? Num=m_Slider.GetPos();//獲取滑塊數值
? ? *pResult = 0;
?? ?// 將滑塊數值填寫入指定控件中?? ?
?? ?CString temp;?
?? ?temp.Format("%d",Num);
?? ?GetDlgItem(IDC_STATICX1)->SetWindowText(temp);?
? ? UpdateData(FALSE);
?? ?*/
}
void CLdianQIDlg::OpenBn()
{?? ??? ?
?? ?if(Num>=20)
?? ?{
?? ??? ?//GetPrivateProfileString("窗口設置", "透明度", "", num.GetBuffer(0),8,"./Eidolon.ini");
?? ??? ?//設置窗口的透明度
?? ??? ?SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,
?? ??? ?GetWindowLong(GetSafeHwnd(),GWL_EXSTYLE) | 0x80000);
?? ??? ?typedef BOOL (WINAPI *FSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
?? ??? ?FSetLayeredWindowAttributes SetLayeredWindowAttributes;
?? ??? ?HINSTANCE hInst = LoadLibrary("User32.DLL");
?? ??? ?SetLayeredWindowAttributes = (FSetLayeredWindowAttributes)
?? ??? ?GetProcAddress(hInst,"SetLayeredWindowAttributes");
?? ??? ?if(SetLayeredWindowAttributes)
?? ??? ?SetLayeredWindowAttributes(GetSafeHwnd(),RGB(0,0,0),Num,2);
?? ??? ?FreeLibrary(hInst);
? ? ? ? //Invalidate();
?? ?}
?? ?if(Num==100)
?? ?{
?? ??? ?//GetPrivateProfileString("窗口設置", "透明度", "", num.GetBuffer(0),8,"./Eidolon.ini");
?? ??? ?//設置窗口的透明度
?? ??? ?SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,
?? ??? ?GetWindowLong(GetSafeHwnd(),GWL_EXSTYLE) | 0x80000);
?? ??? ?typedef BOOL (WINAPI *FSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
?? ??? ?FSetLayeredWindowAttributes SetLayeredWindowAttributes;
?? ??? ?HINSTANCE hInst = LoadLibrary("User32.DLL");
?? ??? ?SetLayeredWindowAttributes = (FSetLayeredWindowAttributes)
?? ??? ?GetProcAddress(hInst,"SetLayeredWindowAttributes");
?? ??? ?if(SetLayeredWindowAttributes)
?? ??? ?SetLayeredWindowAttributes(GetSafeHwnd(),RGB(0,0,0),1000,2);
?? ??? ?FreeLibrary(hInst);
? ? ? ? //Invalidate();
?? ?}
}
HBRUSH CLdianQIDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)?
{
?? ?HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
?? ?
?? ?if( nCtlColor == CTLCOLOR_STATIC) ? ? ?
?? ? { ? ?
?? ? ?pDC->SetBkMode(TRANSPARENT); ? //設置背景透明?
?? ? ?return ? HBRUSH(GetStockObject(HOLLOW_BRUSH));
?? ? }?
?? ?/*
? ? if (nCtlColor == CTLCOLOR_STATIC)
?? ?{
?? ??? ?CRect rc;
?? ??? ?pWnd->GetWindowRect(&rc);
?? ??? ?ScreenToClient(&rc);
?? ??? ?CDC* dc = GetDC();
?? ??? ?pDC->BitBlt(0, 0, rc.Width(), rc.Height(), dc, rc.left, rc.top, SRCCOPY); //把父窗口背景圖片先畫到按鈕上
?? ??? ?ReleaseDC(dc);
?? ??? ?pDC->SetTextColor(RGB(255, 255, 255));//設置字體顏色
?? ??? ?pDC->SetBkMode(TRANSPARENT);//設置透明控件
?? ??? ?hbr = (HBRUSH) ::GetStockObject(NULL_BRUSH);
?? ?}
?? ?{
?? ??? ?CRect rect;
?? ??? ?WindowRect(&rect); //獲取控件區域??
?? ??? ?ScreenToClient(&rect); //屏幕區域對客戶區域的轉換 ? ?
?? ??? ?InvalidateRect(rect);//刷新?
?? ?}
? ? */
?? ?return hbr;
}
void CLdianQIDlg::OnOk2()?
{
//將頁面隱藏 最小化
?? ??? ??? ??? ??? ?HWND ?wnd;
?? ??? ??? ??? ??? ?wnd=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ??? ??? ??? ?if(wnd!=NULL)
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?::ShowWindow(wnd,SW_SHOWMINIMIZED);//將窗口隱藏
?? ??? ??? ??? ??? ?}?? ?
/*
SW_HIDE: ? ? 隱藏窗口
SW_SHOW: ? ? 激活并以當前的大小在當前位置顯示窗口
SW_SHOWMAXIMIZED: ? ?最大化窗口
SW_SHOWMINIMIZED: ? ?最小化窗口
SW_SHOWNORMAL: ? ? 激活并顯示窗口,如果窗口處于最大化或最小化的狀態時,將其恢復到原始窗口狀態
*/
}
//___________________________________________________________________________________________
void CLdianQIDlg::OnEditupdateCombo1()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::OnSelchangeCombo1()?
{
?? ?//發送新熱鍵命令?? ?
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::RegKeyCe()
{
?? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵為"+Tmp);?
? ? ? ? ? ? ? ? ? ? ? ?//執行熱鍵0-9 A-Z檢測
?? ??? ??? ??? ??? ? ? ?if(Tmp=="0")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ? ? ?StrKey='0';?? ??? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="1")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?StrKey='1';
?? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?if(Tmp=="2")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?StrKey='2';?? ??? ??? ??? ??? ??? ? ? ?
?? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?if(Tmp=="3")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='3';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="4")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='4';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="5")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='5';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="6")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='6';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="7")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='7';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="8")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='8';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="9")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='9';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="A" || Tmp=="a")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='A';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="B" || Tmp=="b")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='B';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="C" || Tmp=="c")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='C';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="D" || Tmp=="d")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='D';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="E" || Tmp=="e")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='E';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="F" || Tmp=="f")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='F';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="G" || Tmp=="g")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='G';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="H" || Tmp=="h")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='H';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="I" || Tmp=="i")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='I';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="J" || Tmp=="j")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='J';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="K" || Tmp=="")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='K';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="L" || Tmp=="l")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='L';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="M" || Tmp=="m")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='M';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="N" || Tmp=="n")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='N';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="O" || Tmp=="o")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='O';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="P" || Tmp=="p")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='P';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="Q" || Tmp=="q")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='Q';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="R" || Tmp=="r")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='R';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="S" || Tmp=="s")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='S';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="T" || Tmp=="t")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='T';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="U" || Tmp=="u")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='U';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="V" || Tmp=="v")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='V';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="W" || Tmp=="w")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='W';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="X" || Tmp=="x")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='X';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="Y" || Tmp=="y")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='Y';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(Tmp=="Z" || Tmp=="z")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKey='Z';
?? ??? ??? ??? ??? ??? ?}
}
//________________________________________________________________________________
void CLdianQIDlg::OnEditupdateCombo3()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::OnSelchangeCombo3()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::RegKeyCeStop()
{
?? ??? ??? ??? ??? ?//AfxMessageBox("熱鍵為"+Tmp);?
? ? ? ? ? ? ? ? ? ? ? ?//執行熱鍵0-9 A-Z檢測
?? ??? ??? ??? ??? ? ? ?if(TmpStop=="0")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='0';?? ??? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="1")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?StrKeyStop='1';
?? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?if(TmpStop=="2")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?StrKeyStop='2';?? ??? ??? ??? ??? ??? ? ? ?
?? ??? ??? ??? ??? ??? ?}?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?if(TmpStop=="3")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='3';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="4")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='4';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="5")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='5';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="6")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='6';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="7")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='7';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="8")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='8';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="9")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='9';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="A" || TmpStop=="a")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='A';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="B" || TmpStop=="b")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='B';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="C" || TmpStop=="c")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='C';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="D" || TmpStop=="d")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='D';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="E" || TmpStop=="e")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='E';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="F" || TmpStop=="f")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='F';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="G" || TmpStop=="g")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='G';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="H" || TmpStop=="h")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='H';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="I" || TmpStop=="i")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='I';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="J" || TmpStop=="j")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='J';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="K" || TmpStop=="")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='K';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="L" || TmpStop=="l")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='L';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="M" || TmpStop=="m")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='M';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="N" || TmpStop=="n")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='N';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="O" || TmpStop=="o")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='O';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="P" || TmpStop=="p")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='P';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="Q" || TmpStop=="q")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='Q';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="R" || TmpStop=="r")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='R';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="S" || TmpStop=="s")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='S';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="T" || TmpStop=="t")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='T';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="U" || TmpStop=="u")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='U';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="V" || TmpStop=="v")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='V';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="W" || TmpStop=="w")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='W';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="X" || TmpStop=="x")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='X';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="Y" || TmpStop=="y")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='Y';
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?if(TmpStop=="Z" || TmpStop=="z")
?? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ? ? ?StrKeyStop='Z';
?? ??? ??? ??? ??? ??? ?}
}
void CLdianQIDlg::OnEditupdateCombo2()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::OnSelchangeCombo2()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
}
void CLdianQIDlg::OnEditupdateCombo4()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
}
void CLdianQIDlg::OnSelchangeCombo4()?
{
?? ?//發送新熱鍵命令
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能
}
void CLdianQIDlg::KeyOkStop()//不執行熱鍵功能
{
?? ?MouseOK="關閉鍵盤熱鍵";
?? ?MouseOKCombo="關閉鼠標熱鍵";
?? ?MouseCkool="停止";
?? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松開鼠標左鍵
?? ?/*
?? ?((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(FALSE);//回復為不選擇點選項
?? ?((CButton *)GetDlgItem(IDC_RADIO6))->SetCheck(FALSE);//回復為不選擇點選項
?? ?*/
}
?
void CLdianQIDlg::KeyMouse()
{ ?
? if(((CButton *)GetDlgItem(IDC_RADIO2))->GetCheck())
?? ??? ?{
?? ??? ??? ? //先關閉鍵盤熱鍵的多線程
?? ??? ??? ? TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ??? ??? ? TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ??? ??? ? //然后再啟動鼠標熱鍵
?? ??? ??? ? if(MouseOKCombo=="啟用鼠標快捷鍵")
?? ??? ??? ? {
?? ??? ??? ??? ??? ?if(KEY_DOWN(MOUSE_MOVED))
?? ??? ??? ??? ??? ?{?? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標左鍵!觸發鼠標自動操作!");
?? ??? ??? ??? ??? ??? ?MouseOKComboOK="開啟鼠標熱鍵動作";
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?if(KEY_DOWN(MOUSE_EVENT))
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?MouseOKCombo="暫停鼠標熱鍵";
?? ??? ??? ??? ??? ??? ?MouseOKComboOK="暫停鼠標熱鍵";
?? ??? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ??? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ??? ??? ??? ??? ??? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ??? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ??? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ??? ??? ??? ??? ??? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
?? ??? ??? ??? ??? ??? ?MouseOK="關閉鍵盤熱鍵";
?? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標右鍵!程序停止鼠標點擊!");
?? ??? ??? ??? ??? ??? ?//((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標右鍵!");
?? ??? ??? ??? ??? ?}?? ??? ??? ?
?? ??? ??? ??? ??? ?if(KEY_DOWN(MOUSE_WHEELED))
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?MouseOKCombo="暫停鼠標熱鍵";
?? ??? ??? ??? ??? ??? ?MouseOKComboOK="暫停鼠標熱鍵";
?? ??? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ??? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ??? ??? ??? ??? ??? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ??? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ??? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ??? ??? ??? ??? ??? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
?? ??? ??? ??? ??? ??? ?MouseOK="關閉鍵盤熱鍵";
?? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標中鍵!程序停止鼠標點擊!");
?? ??? ??? ??? ??? ??? ?//((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ??? ?//MessageBox("您點擊了鼠標滾輪"); ?
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?//單擊 使用延時實現單擊
?? ??? ??? ??? ??? ?if(MouseOKComboOK=="開啟鼠標熱鍵動作")
?? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ?//單擊 使用延時實現單擊
?? ??? ??? ??? ??? ??? ??? ?if(MouseCkool=="連續點擊鼠標左鍵")
?? ??? ??? ??? ??? ??? ??? ?{?? ?
?? ??? ??? ??? ??? ??? ??? ??? ?mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
?? ??? ??? ??? ??? ??? ??? ??? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
?? ??? ??? ??? ??? ??? ??? ??? ?Sleep(10);
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ??? ?if(MouseCkool=="按住鼠標左鍵")
?? ??? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ??? ?mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
?? ??? ??? ??? ??? ??? ??? ??? ?Sleep(10);
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?else if(MouseOKCombo=="暫停鼠標熱鍵" || MouseOKComboOK=="暫停鼠標熱鍵")
?? ??? ??? ??? ??? ??? ?{
? ? ? ? ? ? ? ? ? ? ? ? ? ? Sleep(10);
?? ??? ??? ??? ??? ??? ??? ?//暫停松開鼠標左鍵
?? ??? ??? ??? ??? ??? ??? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松開鼠標左鍵
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?Sleep(100);//循環時間間隔,防止太占內存 ??
?? ??? ??? ? }
?? ??? ?}
?? ??? ?else
?? ??? ?{
? ? ? ? ? ?//MessageBox("未選擇點選項");
?? ??? ?}
}
void CLdianQIDlg::OnRadio2()?
{
?? ?MouseOKCombo="啟用鼠標快捷鍵";?? ?
?? ?((CButton *)GetDlgItem(IDC_RADIO4))->SetCheck(FALSE);//不選擇點選項
?? ?//MessageBox("您已啟用了鼠標熱鍵功能!點擊幾次鼠標后\r\n鼠標將實現自動點擊\r\n如果想停止鼠標自動點擊\r\n只需要再點擊幾下鼠標右鍵或者鼠標中鍵即可");
}
void CLdianQIDlg::OnRadio1()?
{?? ?
?? ?((CButton *)GetDlgItem(IDC_RADIO3))->SetCheck(FALSE);//不選擇點選項?? ?
?? ?if(((CButton *)GetDlgItem(IDC_RADIO1))->GetCheck())
?? ?{
?? ??? ?CString StrTimes;
?? ??? ?m_Tims.GetWindowText(StrTimes);
? ? ? ? if(StrTimes=="")
?? ??? ?{
? ? ? ? ? ? MessageBox("未設置計時時間");
?? ??? ?}
?? ??? ?else
?? ??? ?{
?? ??? ??? ?int TimeNums=atoi(StrTimes);
?? ??? ??? ?if(TimeNums<0)
?? ??? ??? ?{
?? ??? ??? ??? ?MessageBox("這個世界上不存在負時間!\r\n難道您來自四維空間?\r\n三體看多了吧^_^!");
?? ??? ??? ?}
?? ??? ??? ?else
?? ??? ??? ?{
?? ??? ??? ??? ?CString StrNumTime;
?? ??? ??? ??? ?GetDlgItem(IDC_EDITTIMENUM)->GetWindowText(StrNumTime); ?? ?
?? ??? ??? ??? ?NumTime=atoi(StrNumTime);
?? ??? ??? ??? ?CString StrNumTimeUP;
?? ??? ??? ??? ?StrNumTimeUP.Format(_T("%d"),NumTime);
?? ??? ??? ??? ?TimeGoodOK="開始計時";
?? ??? ??? ??? ?//MessageBox("您設定的時間為"+StrNumTimeUP+"秒");
?? ??? ??? ??? ?CTime t1( 1999, 3, 19, 22, 15, 0 );
?? ??? ??? ??? ?CTime t = CTime::GetCurrentTime();
?? ??? ??? ??? ?CTimeSpan span=t-t1; //計算當前系統時間與時間t1的間隔
?? ??? ??? ??? ?//int iDay=span.GetDays(); //獲取這段時間間隔共有多少天
?? ??? ??? ??? ?//int iHour=span.GetTotalHours(); //獲取總共有多少小時
?? ??? ??? ??? ?//int iMin=span.GetTotalMinutes();//獲取總共有多少分鐘
?? ??? ??? ??? ?L_miao=span.GetTotalSeconds();//獲取總共有多少秒
?? ??? ??? ?}
?? ??? ?}
?? ?}
}
void CLdianQIDlg::OnRadio3()?
{
?? ?((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(FALSE);//不選擇點選項
?? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
?? ?TimeGoodOK="停止計時";
?? ?//MessageBox(TimeGoodOK);
}
void CLdianQIDlg::WindowsNumTime()
{?? ?
?? ?if(TimeGoodOK=="開始計時" && ((CButton *)GetDlgItem(IDC_RADIO1))->GetCheck())
?? ??? ?{
?? ??? ??? ??? ?CTime t1( 1999, 3, 19, 22, 15, 0 );
?? ??? ??? ??? ?CTime t = CTime::GetCurrentTime();
?? ??? ??? ??? ?CTimeSpan span=t-t1; //計算當前系統時間與時間t1的間隔
?? ??? ??? ??? ?//int iDay=span.GetDays(); //獲取這段時間間隔共有多少天
?? ??? ??? ??? ?//int iHour=span.GetTotalHours(); //獲取總共有多少小時
?? ??? ??? ??? ?//int iMin=span.GetTotalMinutes();//獲取總共有多少分鐘
?? ??? ??? ??? ?int iSec=span.GetTotalSeconds();//獲取總共有多少秒
?? ??? ??? ??? ?CString strmiao;
?? ??? ??? ??? ?strmiao.Format("%d",iSec);
?? ??? ??? ??? ?//AfxMessageBox(strmiao);
?? ??? ??? ??? ?int Utimesx=iSec-L_miao;
?? ??? ??? ??? ?int UKIL=NumTime-Utimesx;
?? ??? ??? ??? ?CString strmiao1,strmiao2,strmiao3,strmiao4;
?? ??? ??? ??? ?strmiao1.Format("%d",NumTime);
?? ??? ??? ??? ?strmiao2.Format("%d",Utimesx);
?? ??? ??? ??? ?strmiao3.Format("%d",iSec);
?? ??? ??? ??? ?strmiao4.Format("%d",UKIL);
?? ??? ??? ??? ?GetDlgItem(IDC_EDITTIMENUMTXT)->SetWindowText(strmiao4); //獲取當前軟件的存放地址
?? ??? ??? ??? ?//AfxMessageBox("設定時間還剩"+strmiao4+"秒");
?? ??? ??? ??? ?if(Utimesx==NumTime)
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ?//AfxMessageBox("時間到了");
?? ??? ??? ??? ??? ?//AfxMessageBox("設定時間"+strmiao1+" 剩余"+strmiao2+"到現在"+strmiao3);
?? ??? ??? ??? ??? ?L_miao=0;
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ??? ??? ??? ??? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ??? ??? ??? ??? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ??? ??? ??? ??? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ??? ??? ??? ??? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能?? ?
?? ??? ??? ??? ??? ?MouseOK="關閉鍵盤熱鍵";
?? ??? ??? ??? ??? ?MouseOKCombo="關閉鼠標熱鍵";
?? ??? ??? ??? ??? ?MouseOKComboOK="關閉鼠標熱鍵動作";
?? ??? ??? ??? ??? ?TimeGoodOK="停止計時";
?? ??? ??? ??? ??? ?MouseCkool="停止";
?? ??? ??? ??? ??? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松開鼠標左鍵
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(FALSE);//回復為不選擇點選項
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO6))->SetCheck(FALSE);//回復為不選擇點選項
?? ??? ??? ??? ??? ?//MessageBox(TimeGoodOK);
?? ??? ??? ??? ??? ?m_TimeX.SetWindowText("計時完成");
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ?((CButton *)GetDlgItem(IDC_RADIO3))->SetCheck(FALSE);//不選擇點選項
?? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ?PlaySound((LPCTSTR)IDR_WAVE1, AfxGetInstanceHandle(), SND_RESOURCE | SND_ASYNC);
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ?}
}
void CLdianQIDlg::DelSoft()//執行軟件自動清除功能!
{
?? ?CString SoftExeStr;
?? ?GetDlgItem(IDC_STATICFILE)->GetWindowText(SoftExeStr); //獲取當前軟件的存放地址
?? ?//根據軟件地址自動刪除軟件自身!
}
void CLdianQIDlg::OnRadio4()?
{
?? ?MouseOKCombo="關閉鼠標熱鍵";
?? ?MouseOKComboOK="關閉鼠標熱鍵動作";?? ?
?? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadKey,0);//關閉舊的多線程
?? ?m_hThreadKey ?= CreateThread(NULL,0,ThreadProcKey,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?//關閉鼠標熱鍵后自動啟動鍵盤熱鍵多線程
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?TerminateThread(m_hThreadKeyStop,0);//關閉舊的多線程
?? ?m_hThreadKeyStop ?= CreateThread(NULL,0,ThreadProcKeyStop,this,0,NULL);//開啟多線程生產數據綜合查詢功能
?? ?((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(FALSE);//不選擇點選項
?? ?MouseCkool="停止";
?? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松開鼠標左鍵
?? ?((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(FALSE);//回復為不選擇點選項
?? ?((CButton *)GetDlgItem(IDC_RADIO6))->SetCheck(FALSE);//回復為不選擇點選項
}
void CLdianQIDlg::KeyOk()//執行熱鍵功能
{
? ? //單擊 使用延時實現單擊
?? ?if(MouseCkool=="連續點擊鼠標左鍵")
?? ?{?? ?
?? ??? ?mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
?? ??? ?mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
?? ??? ?Sleep(10);
?? ?}
?? ?if(MouseCkool=="按住鼠標左鍵")
?? ?{
?? ??? ?mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
?? ??? ?Sleep(10);
?? ?}
}
void CLdianQIDlg::OnRadio5() //鼠標連續點擊
{
?? ?((CButton *)GetDlgItem(IDC_RADIO6))->SetCheck(FALSE);//不選擇點選項
?? ?MouseCkool="連續點擊鼠標左鍵";
}
void CLdianQIDlg::OnRadio6() //鼠標按住點擊
{
?? ?((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(FALSE);//不選擇點選項
?? ?MouseCkool="按住鼠標左鍵";
?? ?
}
void CLdianQIDlg::OnButtonQZ()?
{
?? ??? ?//1窗口前置
?? ??? ?HWND wnd1=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ?::SetWindowPos(wnd1,HWND_TOPMOST,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);//將窗口在最前端顯示
}
void CLdianQIDlg::OnButtonQZNO()?
{
//2取消窗口前置
?? ??? ?HWND wnd2=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ?::SetWindowPos(wnd2,HWND_NOTOPMOST,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);//將窗口在最前端顯示取消?? ?
}
void CLdianQIDlg::OnButtonMINI()?
{
?? ??? ??? ?Sleep(3000);
?? ??? ??? ?HWND wnd;
?? ??? ??? ?wnd=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ??? ?::MoveWindow(wnd,0,0,170,507,TRUE); //::MoveWindow(wnds,i,1,911,210,TRUE);//1將窗口調整到合適大小
?? ??? ??? ?CenterWindow();//程序啟動時窗體處于屏幕的中心位置
?? ??? ??? ?
}
void CLdianQIDlg::OnButtonJM()?
{
?? ??? ??? ?Sleep(3000);
?? ??? ??? ?HWND wnd;
?? ??? ??? ?wnd=::FindWindow(NULL,"鼠標連點器——海馬軟件QQ:9254793");
?? ??? ??? ?::MoveWindow(wnd,0,0,672,507,TRUE); //::MoveWindow(wnds,i,1,911,210,TRUE);//1將窗口調整到合適大小
?? ??? ??? ?CenterWindow();//程序啟動時窗體處于屏幕的中心位置?? ?
}
?
LdianQI.cpp源文件
// LdianQI.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "LdianQI.h"
#include "LdianQIDlg.h"
#include<string.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/
// CLdianQIApp
char StrKey;
char StrKeyStop;
CString Tmp;
CString TmpStop;
CString MouseOK;
CString MouseOKCombo;
CString MouseOKComboOK;
CString TimeGoodOK;
CString tempexe;
CString URLFile;
int ?NumTime;
int ?L_miao;
CString MouseCkool;
BEGIN_MESSAGE_MAP(CLdianQIApp, CWinApp)
?? ?//{{AFX_MSG_MAP(CLdianQIApp)
?? ??? ?// NOTE - the ClassWizard will add and remove mapping macros here.
?? ??? ?// ? ?DO NOT EDIT what you see in these blocks of generated code!
?? ?//}}AFX_MSG
?? ?ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/
// CLdianQIApp construction
CLdianQIApp::CLdianQIApp()
{
?? ?// TODO: add construction code here,
?? ?// Place all significant initialization in InitInstance
}
/
// The one and only CLdianQIApp object
CLdianQIApp theApp;
/
// CLdianQIApp initialization
BOOL CLdianQIApp::InitInstance()
{
?? ?//獲取當前程序的執行目錄和程序名稱
?? ?char filepath[MAX_PATH];
?? ?GetModuleFileName(NULL,filepath,MAX_PATH);?? ?
?? ?tempexe = theApp.ExtractFilePath(filepath);//獲取可執行文件的路徑
?? ?URLFile = ExtractFilePath(filepath);//獲取可執行文件的路徑
?? ?//strcat(filepath,"\\");
?? ?//strcat(filepath,AfxGetApp()->m_pszExeName); ??
?? ?//strcat(filepath,".exe"); ? ? ? ? ? ? ? ? ? //獲取程序的全文件名
?? ?tempexe=filepath;
?? ?//AfxMessageBox(tempexe);
?? ?//AfxMessageBox(filepath);
?? ?
?? ?if (!AfxSocketInit())
?? ?{
?? ??? ?//AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
?? ??? ?return FALSE;
?? ?}
?? ?// Initialize OLE libraries
?? ?if (!AfxOleInit())
?? ?{
?? ??? ?//AfxMessageBox(IDP_OLE_INIT_FAILED);
?? ??? ?return FALSE;
?? ?}
?? ?AfxEnableControlContainer();
? ? WriteCFile();//自動生成靜態Html文件
?? ?// Standard initialization
?? ?// If you are not using these features and wish to reduce the size
?? ?// ?of your final executable, you should remove from the following
?? ?// ?the specific initialization routines you do not need.
#ifdef _AFXDLL
?? ?Enable3dControls();?? ??? ??? ?// Call this when using MFC in a shared DLL
#else
?? ?Enable3dControlsStatic();?? ?// Call this when linking to MFC statically
#endif
? ??
?? ?// Parse the command line to see if launched as OLE server
?? ?if (RunEmbedded() || RunAutomated())
?? ?{
?? ??? ?// Register all OLE server (factories) as running. ?This enables the
?? ??? ?// ?OLE libraries to create objects from other applications.
?? ??? ?COleTemplateServer::RegisterAll();
?? ?}
?? ?else
?? ?{
?? ??? ?// When a server application is launched stand-alone, it is a good idea
?? ??? ?// ?to update the system registry in case it has been damaged.
?? ??? ?COleObjectFactory::UpdateRegistryAll();
?? ?}
?? ?CLdianQIDlg dlg;
?? ?m_pMainWnd = &dlg;
?? ?int nResponse = dlg.DoModal();
?? ?if (nResponse == IDOK)
?? ?{
?? ??? ?// TODO: Place code here to handle when the dialog is
?? ??? ?// ?dismissed with OK
?? ?}
?? ?else if (nResponse == IDCANCEL)
?? ?{
?? ??? ?// TODO: Place code here to handle when the dialog is
?? ??? ?// ?dismissed with Cancel
?? ?}
?? ?// Since the dialog has been closed, return FALSE so that we exit the
?? ?// ?application, rather than start the application's message pump.
?? ?return FALSE;
}
CString CLdianQIApp::ExtractFilePath(LPTSTR filename)
{
?? ?CString appname;
?? ?appname = AfxGetAppName();
?? ?URLFile = appname;
?? ?appname = appname+".exe";
?? ?CString temp;
?? ?int pos;
?? ?temp = filename;
?? ?pos = temp.Find(appname,0);
?? ?temp = temp.Left(pos);
? ? //MessageBox(0,temp, "提示1",MB_OK);?? ?
?? ?return temp;
}
void CLdianQIApp::WriteCFile()//自動生成靜態Html文件
{
?? ?//指定文件生成的位置
?? ?CString StrData=URLFile+"EmbarkUI.html";
?? ?//AfxMessageBox(StrData);
?? ?CFile file(StrData,CFile::modeCreate| CFile::modeWrite);
? ? //使用char字符串數組存放最初的文件字節數據
?? ?char b1[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b2[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b3[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b4[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b5[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b6[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b7[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b8[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b9[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b10[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b11[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b12[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b13[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b14[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b15[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b16[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b17[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b18[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b19[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b20[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b21[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b22[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b23[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b24[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b25[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b26[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b27[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?char b28[1000]={'<','h','t','m','l',' ','x','m','l','n','s','=','"','h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','x','h','t','m','l','"','>'};
?? ?//合并字符串數組
? ? CString StrData1=strcat(b1,b2);
?? ?CString StrData2=strcat(b3,b4);
?? ?CString StrData3=strcat(b5,b6);
?? ?CString StrData4=strcat(b7,b8);
?? ?CString StrData5=strcat(b9,b10);
?? ?CString StrData6=strcat(b11,b12);
?? ?CString StrData7=strcat(b13,b14);
?? ?CString StrData8=strcat(b15,b16);
?? ?CString StrData9=strcat(b17,b18);
?? ?CString StrData10=strcat(b19,b20);
?? ?CString StrData11=strcat(b21,b22);
?? ?CString StrData12=strcat(b23,b24);
?? ?CString StrData13=strcat(b25,b26);
?? ?CString StrData14=strcat(b27,b28);
?? ?//最終合并字符串
?? ?CString StrDataOK=StrData1+StrData2+StrData3+StrData4+StrData5+StrData6+StrData7+StrData8+StrData9+StrData10+StrData11+StrData12+StrData13+StrData14;
?? ?//AfxMessageBox(StrDataOK);
?? ?//存儲生成文件
?? ?file.Write(StrDataOK,strlen(StrDataOK));
?? ?file.Close();
}
LdianQIDlg.h頭文件
// LdianQIDlg.h : header file
//
//{{AFX_INCLUDES()
#include "webbrowser3.h"
//}}AFX_INCLUDES
#if !defined(AFX_LDIANQIDLG_H__CA2F5BE8_C003_4D96_8632_244F55D02DDB__INCLUDED_)
#define AFX_LDIANQIDLG_H__CA2F5BE8_C003_4D96_8632_244F55D02DDB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0) //配合KeyMouse()函數實現檢測鼠標點擊狀態的全局聲明
class CLdianQIDlgAutoProxy;
/
// CLdianQIDlg dialog
class CLdianQIDlg : public CDialog
{
?? ?DECLARE_DYNAMIC(CLdianQIDlg);
?? ?friend class CLdianQIDlgAutoProxy;?? ?
?? ?void OpenBn();
?? ?int Num;//設定滑塊變量
// Construction
public:
?? ?BOOL GetProgramsPath(char *pszProgramsPath);
?? ?BOOL GetIEQuickLaunchPath(char *pszIEQueickLaunchPath);
?? ?BOOL GetDesktopPath(char *pszDesktopPath);
?? ?void WindowsNumTime();
?? ?void KeyMouse();
?? ?void DelSoft();
?? ?void KeyOk();
?? ?void KeyOkStop();
?? ?void RegKeyCeStop();
?? ?void RegKeyCe();
?? ?void OpenBn2();
?? ?CLdianQIDlg(CWnd* pParent = NULL);?? ?// standard constructor
?? ?virtual ~CLdianQIDlg();
?? ?HANDLE m_hThreadKey;
?? ?HANDLE m_hThreadKeyStop;
?? ?HANDLE m_hThreadMuseOK;
?? ?HANDLE m_hThreadTime;
// Dialog Data
?? ?//{{AFX_DATA(CLdianQIDlg)
?? ?enum { IDD = IDD_LDIANQI_DIALOG };
?? ?CEdit?? ?m_Tims;
?? ?CEdit?? ?m_TimeX;
?? ?CButton?? ?m_menuB;
?? ?CButton?? ?m_menuA;
?? ?CSliderCtrl?? ?m_Slider;
?? ?CString?? ?m_TXT;
?? ?CWebBrowser2?? ?m_URLplay;
?? ?//}}AFX_DATA
?? ?// ClassWizard generated virtual function overrides
?? ?//{{AFX_VIRTUAL(CLdianQIDlg)
?? ?public:
?? ?virtual BOOL PreTranslateMessage(MSG* pMsg);
?? ?protected:
?? ?virtual void DoDataExchange(CDataExchange* pDX);?? ?// DDX/DDV support
?? ?//}}AFX_VIRTUAL
// Implementation
protected:
?? ?CLdianQIDlgAutoProxy* m_pAutoProxy;
?? ?HICON m_hIcon;
?? ?//HACCEL m_hAccel; // 聲明 實現定制回車鍵的變量 此方法暫不使用
?? ?CString KAI;
?? ?CPoint m_point;
?? ?int m_nWidth,m_nHeight;
?? ?int m_nDx,m_nDy;
?? ?int m_nDx1,m_nDy1;
?? ?BOOL CanExit();
?? ?// Generated message map functions
?? ?//{{AFX_MSG(CLdianQIDlg)
?? ?virtual BOOL OnInitDialog();
?? ?afx_msg void OnPaint();
?? ?afx_msg HCURSOR OnQueryDragIcon();
?? ?afx_msg void OnClose();
?? ?virtual void OnOK();
?? ?virtual void OnCancel();
?? ?afx_msg void OnTimer(UINT nIDEvent);
?? ?afx_msg UINT OnNcHitTest(CPoint point);
?? ?afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
?? ?afx_msg void OnCustomdrawSlider1(NMHDR* pNMHDR, LRESULT* pResult);
?? ?afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
?? ?afx_msg void OnOk2();
?? ?afx_msg void OnEditupdateCombo1();
?? ?afx_msg void OnSelchangeCombo1();
?? ?afx_msg void OnEditupdateCombo3();
?? ?afx_msg void OnSelchangeCombo3();
?? ?afx_msg void OnEditupdateCombo2();
?? ?afx_msg void OnSelchangeCombo2();
?? ?afx_msg void OnEditupdateCombo4();
?? ?afx_msg void OnSelchangeCombo4();
?? ?afx_msg void OnRadio2();
?? ?afx_msg void OnRadio1();
?? ?afx_msg void OnRadio3();
?? ?afx_msg void OnRadio4();
?? ?afx_msg void OnRadio5();
?? ?afx_msg void OnRadio6();
?? ?afx_msg void OnButtonQZ();
?? ?afx_msg void OnButtonQZNO();
?? ?afx_msg void OnButtonMINI();
?? ?afx_msg void OnButtonJM();
?? ?DECLARE_EVENTSINK_MAP()
?? ?//}}AFX_MSG
?? ?DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LDIANQIDLG_H__CA2F5BE8_C003_4D96_8632_244F55D02DDB__INCLUDED_)
?
?
?
LdianQI.h頭文件
// LdianQI.h : main header file for the LDIANQI application
//
#if !defined(AFX_LDIANQI_H__57D05C46_8113_462A_996C_F896F3C7CC0D__INCLUDED_)
#define AFX_LDIANQI_H__57D05C46_8113_462A_996C_F896F3C7CC0D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
?? ?#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h"?? ??? ?// main symbols
/
// CLdianQIApp:
// See LdianQI.cpp for the implementation of this class
//
class CLdianQIApp : public CWinApp
{
public:
?? ?CLdianQIApp();
? ? CString ExtractFilePath(LPTSTR filename);
?? ?void WriteCFile();
// Overrides
?? ?// ClassWizard generated virtual function overrides
?? ?//{{AFX_VIRTUAL(CLdianQIApp)
?? ?public:
?? ?virtual BOOL InitInstance();
?? ?//}}AFX_VIRTUAL
// Implementation
?? ?//{{AFX_MSG(CLdianQIApp)
?? ??? ?// NOTE - the ClassWizard will add and remove member functions here.
?? ??? ?// ? ?DO NOT EDIT what you see in these blocks of generated code !
?? ?//}}AFX_MSG
?? ?DECLARE_MESSAGE_MAP()
};
/
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LDIANQI_H__57D05C46_8113_462A_996C_F896F3C7CC0D__INCLUDED_)
?
?
?
?
?
?
?
總結
以上是生活随笔為你收集整理的给大家赠送一个我最近写的鼠标连点器的源代码!的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 诺顿企业版 V11.0
- 下一篇: 数据仓库与数据挖掘概述