1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
|
#include<iostream>
#include"string"
#include<windows.h>
#include "winpart.h"
#include "winchat.h"
#include <list>
#include<string>
using namespace std;
WNDCLASS wc;
TCHAR lrst[500];
TCHAR lrsttwo[70000];
struct CHARINFO
{
string charname;
int charstr;
int charremstr;
int chartothealth;
int charremhealth;
int charlevel;
int charxpos;
int charypos;
int zone;
int charinvslot[100];
int bankslot[100];
};
list <CHARINFO> charinfo;
list <CHARINFO>::iterator charinfoiter;
//TCHAR lrsttemp[70000];
DWORD dwExStyle;
//DWORD dwExStyle2;
WPARAM wpar;
DWORD dwStyle;
int end=0;
//DWORD dwStyle2;
HDC hdc=NULL;
HGLRC hrc=NULL;
HWND cheakboxs;
HINSTANCE hInstance;
static HWND list2;
HWND MSGbox;
//HWND list22;
HWND okbutton;
// CMENU menucreation;
//HWND okbutton2;
#define CHANGETEXT 1000
#define CHANGEBKG 1001
#define MAX_LOADSTRING 100
#define edit_box_items 1
#define entry_box_item 2
#define button_pressed 3
TCHAR szTitle[MAX_LOADSTRING];
HWND hWnd;
HWND hWnd2;
bool active =TRUE;
string returnstr;
//string returnstr2;
//string returnstr3;
//string returnstr4;
//string returnstr5;
//void hidewin2();
void setstr(string temp)
{
returnstr=temp;
}
void enterpressedchat()
{
//string temp="";
GetDlgItemText(hWnd,1,lrst,150);
//SetTextColor((HDC)wpar,RGB(250,0,0));
int xcnt=0;
if(lrst[0]!='\0')
{
GetDlgItemText(hWnd,2,lrsttwo,70000);
if(end>=69500)
{
int pcnt=0;
for(int xcnt=1000;lrsttwo[xcnt]!='\0';xcnt++)
{
lrsttwo[pcnt]=lrsttwo[xcnt];
pcnt++;
}
lrsttwo[pcnt]='\0';
end=pcnt;
}
if(end!=0)
{
lrsttwo[end]='\r';
lrsttwo[end+1]='\n';
end++;
end++;
while(lrst[xcnt]!='\0')
{
lrsttwo[end]=lrst[xcnt];
xcnt++;
end++;
}
lrsttwo[end]='\0';
}
else
{
while(lrst[xcnt]!='\0')
{
lrsttwo[end]=lrst[xcnt];
xcnt++;
end++;
}
lrsttwo[end]='\0';
}
//xcnt--;
// lrsttwo=temp.c_str();
SetDlgItemText(hWnd,2,lrsttwo);
}
SetDlgItemText(hWnd,1,"\0");
//SendMessage(
}
string retstr()
{
return returnstr;
}
WNDPROC wpOrigEditProc;
LRESULT CALLBACK EditSubclassProc(HWND hwnd,UINT uMsg, WPARAM wParam, LPARAM lParam)
{
//WNDPROC oldProc;
switch(uMsg)
{
case WM_KEYDOWN:
{
if(wParam==VK_TAB)
{
MessageBox(hWnd,"hi","hi",MB_OK|MB_ICONEXCLAMATION);
return 0;
}
}
}
//oldProc=(WNDPROC)GetWindowLongPtr(hWnd,GWLP_USERDATA);
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam)
{
wpar=wParam;
static COLORREF customcolors[16];
LPCSTR lpcwstr;
HINSTANCE hInst=(HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE);
static LOGBRUSH logbrush;
static TCHAR lpstr[500];
char *newchar=new char[10];
string str="";
int x=0;
int cnt=0;
int numstr;
switch(uMsg)
{
case WM_CREATE:
MSGbox=CreateWindow(TEXT("EDIT"),"",WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|ES_MULTILINE|ES_READONLY,0,20,195,130,hWnd,(HMENU)entry_box_item,hInst,NULL);
list2=CreateWindow(TEXT("EDIT"), "", WS_CHILD|WS_VISIBLE|WS_BORDER|ES_AUTOHSCROLL|ES_WANTRETURN,0,150,165,20, hWnd, (HMENU)edit_box_items, hInst, NULL);//CreateWindow("listbox",szTitle,WS_CHILD|WS_VISIBLE|LBS_STANDARD,15,15,450,90,hWnd,(HMENU)NULL,hInst,NULL);
SetWindowSubclass(list2,GWL_WNDPROC,(LONG_PTR)EditSubclassProc);
break;
case WM_COMMAND:
if(LOWORD(wParam)==3)
{
enterpressedchat();
// GetDlgItemText(MSGbox,2,lrsttwo,70000);
//while(lrst[
//SendMessage(MSGbox,2,"hi there",NULL);
}
case WM_KEYDOWN: case WM_KEYUP:
{
if(wParam==VK_RETURN)
{
enterpressedchat();
}
}
break;
}
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
void showwinchat()
{
//ShowWindow(hWnd,SW_HIDE);
ShowWindow(okbutton,SW_SHOW);
ShowWindow(hWnd,SW_SHOW);
//SetLayeredWindowAttributes(hWnd,0,50,LWA_ALPHA);
}
void hidewinchat()
{
ShowWindow(hWnd,SW_HIDE);
}
void initwindowrectchat()
{
LPCSTR winrec="Text Box";
//LPCWSTR winrec2=L"Change two";
hInstance=GetModuleHandle(NULL);
//hInstance2=GetModuleHandle(NULL);
wc.style=CS_HREDRAW|CS_VREDRAW|CS_OWNDC;
wc.lpfnWndProc=(WNDPROC)WndProc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hInstance=hInstance;
wc.hIcon=LoadIcon(NULL,IDI_HAND);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground=(HBRUSH)GetStockObject(LTGRAY_BRUSH);
wc.lpszMenuName="IDC_HEIGHTMAP";
wc.lpszClassName="DarkGDK";
if(!RegisterClass(&wc))
{
MessageBox(NULL,"Failed to Register the window class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
//return false;
}
hWnd=CreateWindowEx(dwExStyle,"DarkGDK",winrec,dwStyle|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW,0,0,210,240,NULL,NULL,hInstance,NULL);
hInstance=GetModuleHandle(NULL);
SetLayeredWindowAttributes(hWnd,0,50,LWA_ALPHA);
SetForegroundWindow(hWnd);
}
|