macro issues

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

macro issues

Post by arcticir » 11 Feb 2020, 17:43

In this example, scrolling the wheel multiple times in the GUI will cause an error.
Removing "macro" will become normal.
Exception was caused in thread id: 13616
Line: 20
Specifically: MouseGetPos(,,,hwnd,2)

Code: Select all

new_class("test")
hwnd:=CreateWindowEx(,"test",,0X80000000|0X10000000,222,222,222,222)
sleep -1

  new_class(class,proc:="_default_class_proc",back:=16){
        c:=struct(r:="UINT cbSize;UINT style;LPDWORD lpfnWndProc;int cbClsExtra;int cbWndExtra;HINSTANCE hInstance;HICON hIcon;HCURSOR hCursor;HBRUSH hbrBackground;LPCSTR lpszMenuName;UINT lpszClassName;HICON hIconSm;")
        c.cbSize:=sizeof(r)
        c.style:=3
        c.lpfnWndProc:=CallbackCreate(proc,"F",4)
        c.hInstance:=A_ModuleHandle
        c.hCursor:=LoadCursor(0,32512)
        c.hbrBackground:=CreateSolidBrush(0x9a6a20)
        c.lpszClassName:=&class
        return RegisterClassEx(c[""])
    }
return
_default_class_proc(h,m,w,l){
  if m=522
  {
    MouseGetPos ,,,hwnd,2
    flux_scroll_WheelDown2()
  } else
  return DefWindowProc(h,m,w,l)
}
macro flux_scroll_WheelDown2(){
  sleep 100000
}

Return to “AutoHotkey_H”