-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwindowsUniModFunction.cpp
46 lines (40 loc) · 1.1 KB
/
windowsUniModFunction.cpp
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
#include "stdafx.h"
#include "windowUniMod.h"
// ñþäà âñå ôóíêöèè êîòîðûå ñâÿçàííû ñ îêíàìè è þçàþòñÿ â íåñêîëüêèõ ôàéëàõ
void *(__cdecl *noxCallWndProc)(void* Window,int Msg,int A,int B);
void *(__cdecl *noxWndLoad)(char const *WndName,void *WndProc);
int (__cdecl *noxWndGetPostion) (void* Window,int *xLeft,int *yTop);
wndStruct *wndGetHandleByLua(int idx) // äîñòàåì õåíäë îêíà ïî èäèêñó
{
int Top=lua_gettop(L);
wndStruct *H=0;
if(lua_type(L,idx)==LUA_TLIGHTUSERDATA)
H=(wndStruct*) lua_touserdata(L,idx);
else if(lua_type(L,idx)==LUA_TTABLE)
{
lua_getfield(L,idx,"handle");
if(lua_type(L,-1)!=LUA_TLIGHTUSERDATA)
{
lua_pushstring(L,"wrong args!");
lua_error(L);
}
H=(wndStruct*) lua_touserdata(L,-1);
}
else
{
lua_pushstring(L,"wrong args!");
lua_error(L);
}
lua_settop(L,Top);
return H;
}
extern void windowsInit();
extern void windowMsgInit(lua_State*L);
void windowsAllInit()
{
windowsInit();
windowMsgInit(L);
ASSIGN(noxCallWndProc,0x46B490);
ASSIGN(noxWndLoad,0x4A0AD0);
ASSIGN(noxWndGetPostion,0x46AA60);
}