mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Re-fixed commit e62b5c0 (correct variant)
This commit is contained in:
@@ -881,6 +881,21 @@ long GetScriptLocalVars(long sid) {
|
||||
return (script) ? script->num_local_vars : 0;
|
||||
}
|
||||
|
||||
// Returns window ID by x/y coordinate (hidden windows are ignored)
|
||||
long __fastcall GetTopWindowID(long xPos, long yPos) {
|
||||
WINinfo* win = nullptr;
|
||||
long countWin = *(DWORD*)_num_windows - 1;
|
||||
for (int n = countWin; n >= 0; n--) {
|
||||
win = (WINinfo*)ptr_window[n];
|
||||
if (xPos >= win->wRect.left && xPos <= win->wRect.right && yPos >= win->wRect.top && yPos <= win->wRect.bottom) {
|
||||
if (!(win->flags & WIN_Hidden)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return win->wID;
|
||||
}
|
||||
|
||||
void __fastcall RegisterObjectCall(long* target, long* source, void* func, long delay) {
|
||||
__asm {
|
||||
mov eax, ecx;
|
||||
|
||||
@@ -1045,6 +1045,8 @@ long __stdcall ScrPtr(long scriptId, TScript** scriptPtr);
|
||||
// Returns the number of local variables of the object script
|
||||
long GetScriptLocalVars(long sid);
|
||||
|
||||
long __fastcall GetTopWindowID(long xPos, long yPos);
|
||||
|
||||
void __fastcall RegisterObjectCall(long* target, long* source, void* func, long delay);
|
||||
|
||||
long __fastcall ScrGetLocalVar(long sid, long varId, long* value);
|
||||
|
||||
+2
-11
@@ -228,17 +228,8 @@ static long __stdcall gmouse_handle_event_hook() {
|
||||
|
||||
static void __declspec(naked) gmouse_bk_process_hook() {
|
||||
__asm {
|
||||
call win_get_top_win_;
|
||||
cmp eax, ds:[_display_win];
|
||||
jnz checkFlag;
|
||||
retn;
|
||||
checkFlag:
|
||||
call GNW_find_;
|
||||
test [eax + 4], WIN_Hidden; // window flags
|
||||
jz skip;
|
||||
mov eax, ds:[_display_win]; // window is hidden, so return the number of the display_win
|
||||
skip:
|
||||
retn;
|
||||
mov ecx, eax;
|
||||
jmp GetTopWindowID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user