--------------Enable You!.cpp----------------------- 入口函数 #include "main.h" #include "resource.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG_MAIN), NULL, Main_Proc); return(0); } ------------------main.cpp---------------------------------------- #include <windows.h> #include <windowsx.h> #include "main.h" #include "resource.h" #include "stdio.h" #include "stdlib.h" int i; typedef unsigned (__stdcall *LPTHREADFUNC)(void *); BOOL WINAPI Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { //BEGIN MESSAGE CRACK HANDLE_MSG(hWnd, WM_INITDIALOG, Main_OnInitDialog); HANDLE_MSG(hWnd, WM_COMMAND, Main_OnCommand); HANDLE_MSG(hWnd,WM_CLOSE, Main_OnClose); //END MESSAGE CRACK } return FALSE; } //////////////////////////////////////////////////////////////////////////////// // Main_OnInitDialog BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { // Set app icons HICON hIcon = LoadIcon((HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE) ,MAKEINTRESOURCE(IDI_ICONAPP)); SendMessage(hwnd, WM_SETICON, TRUE, (LPARAM)hIcon); SendMessage(hwnd, WM_SETICON, FALSE, (LPARAM)hIcon); int k=0; SetWindowText(GetDlgItem(hwnd,IDC_EDIT_TIME),"5"); return TRUE; } //////////////////////////////////////////////////////////////////////////////// // Main_OnCommand void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { char temp2[64],temp[64],Time[64]; int k=0; HMENU hMenu,hSubMenu; HWND Main; switch(id) { case IDC_BUTTON_ENABLE: i=0; GetWindowText(GetDlgItem(hwnd,IDC_EDIT_TIME),Time,GetWindowTextLength(GetDlgItem(hwnd,IDC_EDIT_TIME))+1); sprintf(temp2,"程序将在%d秒后启动,请做好准备,迅速切换至要执行突破的窗口.(^_^)",atoi(Time)); MessageBox(hwnd,temp2,"提示",MB_OK); Sleep(atoi(Time)*1000); Main=GetForegroundWindow(); SendMessage(GetDlgItem(hwnd,IDC_EDIT_DEBUG),EM_REPLACESEL,1,(LPARAM)"Discover Symbols:...\n"); EnumChildWindows(Main,EnumChildProc,(LPARAM)Main) ; //Enable Menu hMenu=GetMenu(Main); itoa(GetMenuItemCount(hMenu),temp2,10); wsprintf(temp,"Discover MenuItems :%d \n",temp2); SendMessage(GetDlgItem(hwnd,IDC_EDIT_DEBUG),EM_REPLACESEL,1,(LPARAM)temp); for (;k<GetMenuItemCount(hMenu);k++) { EnableMenuItem(hMenu,GetMenuItemID(hMenu,k),MF_ENABLED); hSubMenu=GetSubMenu(hMenu,0); EnableMenuItem(hSubMenu,GetMenuItemID(hSubMenu,0),MF_ENABLED); } SendMessage(GetDlgItem(hwnd,IDC_EDIT_DEBUG),EM_REPLACESEL,1,(LPARAM)"完成!"); break; case IDC_BUTTON_HELP: MessageBox(hwnd, "Windows按钮突破者(Enable You!),彻底摧毁灰色控件!\n在Time:框中填入开始时间(秒)\n\t\ Made By 全金属外壳" ,"About",MB_OK); break; default:break; } } //////////////////////////////////////////////////////////////////////////////// // Main_OnClose void Main_OnClose(HWND hwnd) { EndDialog(hwnd, 0); } //////////////////////////////////////////////////////////////////////////////////// BOOL CALLBACK EnumChildProc( HWND hwndChild,LPARAM lParam_hmain) { EnableWindow(hwndChild,TRUE) ; return true; } //////////////////////////////////////////////////////////////////////////
|