NetClient辅助程序,离线自动拨号
希望大家测试一下,有什么问题告诉我 是NetClient盗号程序吧,哇哈哈,我下个看看! 为什么下不了呢? #include
#include "resource.h"
#define APPNAME "AutoDial"
#define WM_MyIcon WM_USER + 100
const char szRegKeyName[] = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components\\51AF6AC6C47EC36459D07877B938F76E";
const char szRegChar[] = "A0CDAE5BF3ECD0F439C33E627F3DA3E5";
const char szHzcncClassName[] = "TfrmMainNetClient";
const char szClassName[ ] = "AutoDialForm";
HWND hNetClient,hConnectButton;
HICON hIcon;
HMENU hPopMenu;
LRESULT CALLBACK WindowProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK EditProc(HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
int RunNetClient(void);
NOTIFYICONDATA MyIcon;
WNDPROC EditOldWndFunc;
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
hIcon = LoadIcon(hThisInstance,MAKEINTRESOURCE(IDI_ICON));
hPopMenu = GetSubMenu(LoadMenu(hThisInstance,MAKEINTRESOURCE(IDR_MENU1)),0);
DialogBox(hThisInstance, MAKEINTRESOURCE(IDD_MAIN_DLG), NULL, (DLGPROC)WindowProc);
return 0;
}
LRESULT CALLBACK WindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static UINT times = 0;
switch (message) /* handle the messages */
{
case WM_INITDIALOG:
hNetClient = FindWindow(szHzcncClassName,NULL);
if(!hNetClient)
{
switch(RunNetClient())
{
case 0 :
break;
case 1 :
MessageBox(hwnd,"请确定是否正确安装网通拨号软件!",APPNAME,MB_OK);
break;
case 2 :
MessageBox(hwnd,"无法运行拨号软件!",APPNAME,MB_OK);
}
hNetClient = FindWindow(szHzcncClassName,NULL);
}
hConnectButton = FindWindowEx(hNetClient,NULL,NULL,"连接");
SendMessage(hwnd,WM_SETICON,ICON_BIG,(LPARAM)hIcon);
MyIcon.cbSize = sizeof(NOTIFYICONDATA);
MyIcon.hWnd = hwnd;
MyIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
MyIcon.uID = 1;
MyIcon.hIcon =hIcon;
MyIcon.uCallbackMessage = WM_MyIcon;
lstrcpy(MyIcon.szTip,"自动拨号");
SetDlgItemInt(hwnd,IDC_EDIT1,1,0);
SetDlgItemInt(hwnd,IDC_EDIT2,0,0);
SetDlgItemText(hwnd,IDC_EDIT3,"11:29:00");
EditOldWndFunc = (WNDPROC)SetWindowLong(GetDlgItem(hwnd,IDC_EDIT3),GWL_WNDPROC,EditProc);
return 1;
break;
case WM_TIMER:
hNetClient = FindWindow(szHzcncClassName,NULL);
if (!hNetClient)
{
KillTimer(hwnd,0);
break;
}
if(IsWindowEnabled(hConnectButton))
{
if(times < GetDlgItemInt(hwnd,IDC_EDIT2,NULL,0) || GetDlgItemInt(hwnd,IDC_EDIT2,NULL,0) == 0)
{
SendMessage(hConnectButton,BM_CLICK,0,0);
times++;
}
}
break;
case WM_COMMAND:
switch( LOWORD(wParam) )
{
case IDOK:
SetTimer(hwnd,0,1000 * GetDlgItemInt(hwnd,IDC_EDIT1,NULL,0),NULL);
ShowWindow(hwnd,SW_HIDE);
Shell_NotifyIcon(NIM_ADD,&MyIcon);
times = 0;
break;
case IDM_SETTING:
ShowWindow(hwnd,SW_NORMAL);
Shell_NotifyIcon(NIM_DELETE,&MyIcon);
KillTimer(hwnd,0);
break;
case IDCANCEL:
case IDM_EXIT:
Shell_NotifyIcon(NIM_DELETE,&MyIcon);
KillTimer(hwnd,0);
EndDialog( hwnd, 0 );
return TRUE;
}
return 1;
case WM_MyIcon:
if(lParam == WM_RBUTTONDOWN )
{
POINT pt;
GetCursorPos(&pt);
SetForegroundWindow(hwnd);
TrackPopupMenu(hPopMenu,TPM_RIGHTBUTTON,pt.x,pt.y,NULL,hwnd,NULL);
PostMessage(hwnd,WM_NULL,NULL,NULL);
}
break;
case WM_DESTROY:
EndDialog(hwnd,0);
return 1;
break;
}
return 0;
}
LRESULT CALLBACK EditProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_KEYDOWN:
case WM_KEYUP:
case WM_CHAR:
break;
default:
CallWindowProc(EditOldWndFunc,hWnd,Msg,wParam,lParam);
}
return 1;
}
int RunNetClient(void)
{
HKEY hkey;
char szAppPath;
DWORD ButterSize = 256;
/*读取网通拨号程序的硬盘位置*/
if (RegOpenKey(HKEY_LOCAL_MACHINE,szRegKeyName,&hkey) != ERROR_SUCCESS)
return 1;
if (RegQueryValueEx(hkey,szRegChar,NULL,NULL,szAppPath,&ButterSize) != ERROR_SUCCESS)
return 1;
RegCloseKey(hkey);
if (ShellExecute(0,"open",szAppPath,NULL,NULL,SW_SHOWNORMAL) <= 32)
return 2;
return 0;
}
以上代码
页:
[1]