看看我这个是不是外挂,联系:QQ:1299062275
这个是界面:
以下是界面设计部分代码全部全C++写成
/*------------------------------------------------------------
HELLOWIN.C -- Displays "Hello, Windows 98!" in client area
(c) Charles Petzold, 1998
------------------------------------------------------------*/
# include "MyFrame.h"
int
string_to_int(string s)
{
istringstream instr(s);
int n;
instr>>n;
return n;
}
string int_to_string(int n)
{
ostringstream outstr;
outstr<<n;
return outstr.str();
}
struct userdate
{
char user_name[20];
int game_numb;
char log_date[20];
int is_logdate;
int is_normal;
int 主体职业;
int 分身职业;
int 有无大包裹;
int 分身战斗模式;
int 有无回城石;
int 通用设置5;
char 回城地点[20];
char 战斗地点[20];
int 到目的地方式;
int 是否冰泉修;
int 是否随机打怪;
int 通用设置11;
int 低血随机飞;
int 低血地牢回城;
int 通用设置14;
int 遇堵门次数;
int 改魔城练级;
int 通用设置17;
char skill_str0[20];
char skill_str1[20];
char skill_str2[20];
char skill_str3[20];
char skill_str4[20];
char skill_str5[20];
char skill_str6[20];
char skill_str7[20];
char skill_str8[20];
char skill_str9[20];
char skill_str10[20];
char skill_str11[20];
char skill_str12[20];
char skill_str13[20];
char skill_str14[20];
char skill_str15[20];
char skill_str16[20];
char skill_str17[20];
char first_skill[20];
char second_skill[20];
char third_skill[20];
int first_skill_numb;
int second_skill_numb;
int third_skill_numb;
char suply_item_string0[20];
char suply_item_string1[20];
char suply_item_string2[20];
char suply_item_string3[20];
char suply_item_string4[20];
char suply_item_string5[20];
char suply_item_string6[20];
char suply_item_string7[20];
char suply_item_string8[20];
char suply_item_string9[20];
char suply_item_string10[20];
char suply_item_string11[20];
char suply_item_string12[20];
char suply_item_string13[20];
char suply_item_string14[20];
char suply_item_string15[20];
char suply_item_string16[20];
char suply_item_string17[20];
char suply_item_string18[20];
char suply_item_string19[20];
int suply_item_numb0;
int suply_item_numb1;
int suply_item_numb2;
int suply_item_numb3;
int suply_item_numb4;
int suply_item_numb5;
int suply_item_numb6;
int suply_item_numb7;
int suply_item_numb8;
int suply_item_numb9;
int suply_item_numb10;
int suply_item_numb11;
int suply_item_numb12;
int suply_item_numb13;
int suply_item_numb14;
int suply_item_numb15;
int suply_item_numb16;
int suply_item_numb17;
int suply_item_numb18;
int suply_item_numb19;
int repair_toukui;
int repair_cloth;
int repair_diamond;
int repair_weapen;
int repair_yaodai;
int repair_xiezi;
int repair_xunzhang;
int repair_dunpai;
int repair_mod0;
int repair_mod1;
int repair_mod2;
int repair_mod3;
int repair_mod4;
int repair_mod5;
int repair_mod6;
int repair_mod7;
}user_date;
void init_userdate(void)
{
strcpy_s(user_date.user_name ,20,"");
user_date.game_numb=0;
strcpy_s(user_date.log_date,20,"");
user_date.is_logdate=0;
user_date.is_normal=0;
user_date.主体职业=0;
user_date.分身职业=0;
user_date.有无大包裹=0;
user_date.分身战斗模式=0;
user_date.有无回城石=0;
user_date.通用设置5=0;
strcpy_s(user_date.回城地点,20,"");
strcpy_s(user_date.战斗地点,20,"");
user_date.到目的地方式=0;
user_date.是否冰泉修=0;
user_date.是否随机打怪=0;
user_date.通用设置11=0;
user_date.低血随机飞=0;
user_date.低血地牢回城=0;
user_date.通用设置14=0;
user_date.遇堵门次数=0;
user_date.改魔城练级=0;
user_date.通用设置17=0;
strcpy_s(user_date.skill_str0,20,"");
strcpy_s(user_date.skill_str1,20,"");
strcpy_s(user_date.skill_str2,20,"");
strcpy_s(user_date.skill_str3,20,"");
strcpy_s(user_date.skill_str4,20,"");
strcpy_s(user_date.skill_str5,20,"");
strcpy_s(user_date.skill_str6,20,"");
strcpy_s(user_date.skill_str7,20,"");
strcpy_s(user_date.skill_str8,20,"");
strcpy_s(user_date.skill_str9,20,"");
strcpy_s(user_date.skill_str10,20,"");
strcpy_s(user_date.skill_str11,20,"");
strcpy_s(user_date.skill_str12,20,"");
strcpy_s(user_date.skill_str13,20,"");
strcpy_s(user_date.skill_str14,20,"");
strcpy_s(user_date.skill_str15,20,"");
strcpy_s(user_date.skill_str16,20,"");
strcpy_s(user_date.skill_str17,20,"");
strcpy_s(user_date.first_skill,20,"");
strcpy_s(user_date.second_skill,20,"");
strcpy_s(user_date.third_skill,20,"");
user_date.first_skill_numb=0;
user_date.second_skill_numb=0;
user_date.third_skill_numb=0;
strcpy_s(user_date.suply_item_string0,20,"超级金创药包");
strcpy_s(user_date.suply_item_string1,20,"超级魔法药包");
strcpy_s(user_date.suply_item_string2,20,"道符");
strcpy_s(user_date.suply_item_string3,20,"红色毒药(中)");
strcpy_s(user_date.suply_item_string4,20,"绿色毒药(中)");
strcpy_s(user_date.suply_item_string5,20,"雄人偶(中)");
strcpy_s(user_date.suply_item_string6,20,"雌人偶(中)");
strcpy_s(user_date.suply_item_string7,20,"超级金创药包");
strcpy_s(user_date.suply_item_string8,20,"超级魔法药包");
strcpy_s(user_date.suply_item_string9,20,"道符");
strcpy_s(user_date.suply_item_string10,20,"红色毒药(中)");
strcpy_s(user_date.suply_item_string11,20,"绿色毒药(中)");
strcpy_s(user_date.suply_item_string12,20,"雄人偶(中)");
strcpy_s(user_date.suply_item_string13,20,"雌人偶(中)");
strcpy_s(user_date.suply_item_string14,20,"地牢卷轴");
strcpy_s(user_date.suply_item_string15,20,"随机卷轴");
strcpy_s(user_date.suply_item_string16,20,"随机卷轴包");
strcpy_s(user_date.suply_item_string17,20,"冰泉圣水");
strcpy_s(user_date.suply_item_string18,20,"补充物品");
strcpy_s(user_date.suply_item_string19,20,"补充物品");
user_date.suply_item_numb0=0;
user_date.suply_item_numb1=0;
user_date.suply_item_numb2=0;
user_date.suply_item_numb3=0;
user_date.suply_item_numb4=0;
user_date.suply_item_numb5=0;
user_date.suply_item_numb6=0;
user_date.suply_item_numb7=0;
user_date.suply_item_numb8=0;
user_date.suply_item_numb9=0;
user_date.suply_item_numb10=0;
user_date.suply_item_numb11=0;
user_date.suply_item_numb12=0;
user_date.suply_item_numb13=0;
user_date.suply_item_numb14=0;
user_date.suply_item_numb15=0;
user_date.suply_item_numb16=0;
user_date.suply_item_numb17=0;
user_date.suply_item_numb18=0;
user_date.suply_item_numb19=0;
user_date.repair_toukui=0;
user_date.repair_cloth=0;
user_date.repair_diamond=0;
user_date.repair_weapen=0;
user_date.repair_yaodai=0;
user_date.repair_xiezi=0;
user_date.repair_xunzhang=0;
user_date.repair_dunpai=0;
user_date.repair_mod0=0;
user_date.repair_mod1=0;
user_date.repair_mod2=0;
user_date.repair_mod3=0;
user_date.repair_mod4=0;
user_date.repair_mod5=0;
user_date.repair_mod6=0;
user_date.repair_mod7=0;
FILE *binaryp;
binaryp=fopen("userdate.bin","wb");
fwrite(&user_date,sizeof(userdate),1,binaryp);
fclose(binaryp);
}
void set_basedate(void)
{
FILE *binaryp;
binaryp=fopen("userdate.bin","wb");
fwrite(&user_date,sizeof(userdate),1,binaryp);
fclose(binaryp);
}
void get_basedate(void)
{
FILE *binaryp;
binaryp=fopen("userdate.bin","rb");
fread(&user_date,sizeof(userdate),1,binaryp);
fclose(binaryp);
}
void 给文件增加行编号(char*filename)
{
ifstream indate;
indate.open(filename);
string s1="",s2="";
int i=0;
while(!indate.eof())
{
getline(indate,s2);
if(s2=="")
break ;
s1=s1+int_to_string(i)+" :"+s2 +"\n";
i++;
}
indate.close();
ofstream out;
out.open(filename);
out<<s1;
out.close();
}
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] =
("HelloWin") ;
HWND
hwnd ;
MSG
msg ;
WNDCLASS
wndclass ;
wndclass.style
= CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc
= WndProc ;
wndclass.cbClsExtra
= 0 ;
wndclass.cbWndExtra
= 0 ;
wndclass.hInstance
= hInstance ;
wndclass.hIcon
= LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor
= LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName
= NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{
MessageBox (NULL,
("This program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
int cxScreen, cyScreen ;
cxScreen = GetSystemMetrics (SM_CXSCREEN) ;
cyScreen = GetSystemMetrics (SM_CYSCREEN) ;
hwnd = CreateWindow (szAppName,
// window class name
("The Hello Program"), // window caption
WS_SYSMENU,
// window style
(cxScreen-xsize_frame)/2,
// initial x position
(cyScreen-ysize_frame)/2,
// initial y position
xsize_frame,
// initial x size
ysize_frame,
// initial y size
NULL,
// parent window handle
NULL,
// window menu handle
hInstance,
// program instance handle
NULL) ;
// creation parameters
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC
hdc ;
PAINTSTRUCT ps ;
static HWND
hwndButton1,hwndButton2, hwndButton3,
hwndButton4,hwndEdit1,hwndText1,hwndText2,hwndText3,frame_hwndLabel1,frame_hwndLabel2,frame_hwndLabel3;
static HWND
frame2_Button1,frame2_LabelHwnd[26],frame2_Combo[24],frame2_Listhwnd[3] ;
static char *frame2_LabelText[]={ "火球术","诱惑之光" ,"雷电术" ,"冰箭术","火墙" ,"冰旋风" , "风影盾", "狂龙紫电" ,"流星火雨" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能","技能设置" ,"技能使用" ,"第一技能" ,"第二技能" ,"第三技能" ,"法师技能","法师技能" ,"法师技能"
};
static HWND frame1_Button1,frame1_ComBox[18],frame1_hwndLabel[20],frame1_hwndList[3] ;
static char * frame1_Label_Text[20] = { "主体职业",
"分身职业", "有无大包裹","分身战斗模式","有无回城石",
"通用设置", "回城地点","挂机地图","去目的地方式",
"修装备模式", "随机飞走图","通用设置","使用随机卷轴",
"使用地牢卷轴", "通用设置","遇堵门次数","改到魔城练级",
"通用设置", "游戏通用设置","保护设置"};
static HWND
frame3_Button1,frame3_LabelHwnd[30];
static HWND frame3_Combo[30],frame3_list[30] ;
static char * frame3_LabelText[] ={
"金创药包" ,
"魔法药包" ,
"道符" ,
"红毒" ,
"绿毒" ,
"雄人偶" ,
"雌人偶" ,
"地牢卷轴" ,
"随机卷轴包" ,
"随机卷轴" ,
"冰泉圣水" ,
"补充物品" ,
"补充物品" ,
"主体补充" ,
"分身补充" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" ,
"物品名称" };
static HWND
frame4_Button1,frame4_LabelHwnd[12],frame4_radio1[3],frame4_Label,frame4_Label1,frame4_Label2,frame4_Label3,frame4_Label4,frame4_Label5,frame4_checkBox[8][4];
static HWND frame4_list[8] ;
static char* frame4_LabelText[] = { "头盔","衣服","首饰","武器","腰带","鞋子","勋章","服装"};
static HWND
frame5_Button1, frame5_Button2, frame5_Button3,frame5_LabelHwnd[MAX_BESTITEM],frame5_ActionHwnd[MAX_BESTITEM],frame5_checkBox[MAX_BESTITEM][2];
static char *frame5_LabelText[MAX_BESTITEM];
static char *frame5_actText[MAX_BESTITEM];
int item_page=0;
static int pg=0;
char *Number_list[]={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"} ;
static RECT
rect ;
static int
cxChar, cyChar ;
switch (message)
{
case WM_CREATE:
cxChar = LOWORD (GetDialogBaseUnits ()) ;
cyChar = HIWORD (GetDialogBaseUnits ()) ;
//获得userdate获得userdate
get_basedate();
//hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
frame2_Button1 = CreateWindow ( TEXT("button"),
TEXT("回城补充物品"),
WS_CHILD | BS_PUSHBUTTON,
4*xsize_frame/5-cxChar, 4*ysize_frame/5+cyChar,
14 * cxChar, 7 * cyChar / 4,
hwnd, (HMENU) frame2_Button1_ID,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
for(int i=0;i<26;i++)
{
if(i<6)
{frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), frame2_LabelText[i], WS_CHILD | SS_LEFT,4*cxChar+ 2*cxChar, cyChar*(2+2*i), 10 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
frame2_Combo[i] = CreateWindow (TEXT ("combobox"), NULL,
WS_CHILD |CBS_DROPDOWNLIST,
4*cxChar+12*cxChar, cyChar*(2+2*i),
10 * cxChar, 24 *cyChar,
hwnd, (HMENU) (i+frame2_Combo_ID),
((LPCREATESTRUCT) lParam)->hInstance,
NULL) ;
}
else if(i>=6 && i<12)
{
frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), frame2_LabelText[i], WS_CHILD | SS_LEFT,4*cxChar+ 24*cxChar, cyChar*(2+2*(i-6)), 10 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
frame2_Combo[i] = CreateWindow (TEXT ("combobox"), NULL,
WS_CHILD | CBS_DROPDOWNLIST,
4*cxChar+34*cxChar, cyChar*(2+2*(i-6)),
10 * cxChar,24 *cyChar,
hwnd, (HMENU) (i+frame2_Combo_ID),
((LPCREATESTRUCT) lParam)->hInstance,
NULL) ;
}
else if(i>=12 && i<18)
{
frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), frame2_LabelText[i], WS_CHILD | SS_LEFT,4*cxChar+ 46*cxChar,
cyChar*(2+2*(i-12)), 10 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
frame2_Combo[i] = CreateWindow (TEXT ("combobox"), NULL,
WS_CHILD | CBS_DROPDOWNLIST,
4*cxChar+56*cxChar, cyChar*(2+2*(i-12)),
10 * cxChar, 24 *cyChar,
hwnd, (HMENU) (i+frame2_Combo_ID),
((LPCREATESTRUCT) lParam)->hInstance,
NULL) ;
}
else if(18==i)
{
frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), "技能按键", WS_CHILD | SS_LEFT, 2*cxChar, 2, 12 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
}
else if(19==i)
{
frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), "使用技能", WS_CHILD | SS_LEFT, 2*cxChar, 14*cyChar, 12 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
}
else if(i>=20 && i<23)
{frame2_LabelHwnd[i] = CreateWindow (TEXT ("static"), frame2_LabelText[i], WS_CHILD | SS_LEFT, 12*cxChar+2*cxChar, cyChar*(2+2*(i-13)), 12 * cxChar, 5 *cyChar / 4, hwnd, (HMENU) (i +frame2_Label_ID), ((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
frame2_Combo[i] = CreateWindow (TEXT ("combobox"), NULL,
WS_CHILD |CBS_DROPDOWNLIST ,//| WS_VSCROLL,
12*cxChar+12*cxChar, cyChar*(2+2*(i-13)),
10 * cxChar, 24 *cyChar,
hwnd, (HMENU) (i+frame2_Combo_ID),
((LPCREATESTRUCT) lParam)->hInstance,
NULL) ;
}
}
for(int i=0;i<3;i++)
{
frame2_Listhwnd[i] = CreateWindow (TEXT ("listbox"), NULL,
WS_CHILD | LBS_STANDARD,
12*cxChar+24*cxChar, (16+2*i)*cyChar,
6 * cxChar, 6*cyChar/4,
hwnd, (HMENU) (i+frame2_list_ID),
((LPCREATESTRUCT) lParam)->hInstance,
NULL) ;
}
for(int i=0;i<20;i++)
{
SendMessage (frame2_Listhwnd[0], LB_INSERTSTRING, i, (LPARAM) Number_list[i]) ;
SendMessage (frame2_Listhwnd[1], LB_INSERTSTRING, i, (LPARAM) Number_list[i]) ;
SendMessage (frame2_Listhwnd[2], LB_INSERTSTRING,i, (LPARAM) Number_list[i]) ;
}
SendMessage (frame2_Listhwnd[0], LB_SETCURSEL, user_date.first_skill_numb, 0 );
SendMessage (frame2_Listhwnd[1], LB_SETCURSEL, user_date.second_skill_numb, 0 );
SendMessage (frame2_Listhwnd[2], LB_SETCURSEL, user_date.third_skill_numb, 0 );
再写入
SendMessage (frame2_Combo[20], CB_RESETCONTENT , 0, 0) ;
SendMessage (frame2_Combo[21], CB_RESETCONTENT , 0, 0) ;
SendMessage (frame2_Combo[22], CB_RESETCONTENT , 0, 0) ;
//运行时改写
for(int i=20;i<23;i++)
{
for(int k=0;k<18;k++)
{
if(user_date.主体职业 ==0)
{
char *frame2_skill_item[]={
"火球术","诱惑之光" ,"雷电术" ,"冰箭术","火墙" ,"冰旋风" , "风影盾", "狂龙紫电" ,"流星火雨" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能" ,"法师技能"};
SendMessage (frame2_Combo[i], CB_INSERTSTRING, k, (LPARAM)
frame2_skill_item[k]) ;
if(strcmp(user_date.first_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[20], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.second_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[21], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.third_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[22], CB_SETCURSEL, k, 0 );
}
else if(user_date.主体职业 ==1)
{
char *frame2_skill_item[]={"治疗术","施毒诅咒术","灵魂道符","隐身术","狮子吼","召唤神兽","强化骷髅术","幽冥火咒","心灵召唤","道士技能","道士技能","道士技能","道士技能","道士技能","道士技能","道士技能","道士技能","道士技能"};
SendMessage (frame2_Combo[i], CB_INSERTSTRING, k, (LPARAM)
frame2_skill_item[k]) ;
if(strcmp(user_date.first_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[20], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.second_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[21], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.third_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[22], CB_SETCURSEL, k, 0 );
}
else if(user_date.主体职业 ==2)
{
char *frame2_skill_item[]={"初级剑法","攻杀剑法","刺杀剑术" , "抱月刀", "半月弯刀" ,"野蛮冲撞" ,"烈火剑法" ,"破击剑法" ,"突斩"
,"破盾斩"
,"擒龙手","武士技能","武士技能","武士技能","武士技能","武士技能","武士技能","武士技能"};
SendMessage (frame2_Combo[i], CB_INSERTSTRING, k, (LPARAM)
frame2_skill_item[k]) ;
if(strcmp(user_date.first_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[20], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.second_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[21], CB_SETCURSEL, k, 0 );
if(strcmp(user_date.third_skill , frame2_skill_item[k])==0)
SendMessage (frame2_Combo[22], CB_SETCURSEL, k, 0 );
}
}
}
ShowWindow(frame2_Button1,SW_SHOW);
[
本帖最后由 nhhykly9d 于 2010-10-20 23:58 编辑 ]