08-21-2007, 07:44 PM
Do I correctly understand:
EXE is class that represents a window and provides functions to get information about the window.
Will try to explain how to create such class.
Since EXE cannot be used, let it be Exe.
Somewhere (eg in init2, or in macro code before using the class) declare the class:
class Exe m_hwnd -str'm_exename -str'm_exepath ;;and so on
Compile the code that contains the declaration.
Create member function (use menu File -> New) named EXE.name:
Similarly create more member functions.
Example macro that declares and uses the class:
This was just one of possible implementations. Maybe you need to get some properties every time the member function is called, instead of caching into member variables. Or get all properties in Exe.Init, which would simplify other member functions.
EXE is class that represents a window and provides functions to get information about the window.
Will try to explain how to create such class.
Since EXE cannot be used, let it be Exe.
Somewhere (eg in init2, or in macro code before using the class) declare the class:
class Exe m_hwnd -str'm_exename -str'm_exepath ;;and so on
Compile the code that contains the declaration.
Create member function (use menu File -> New) named EXE.name:
function'str
if(!this.m_exename.len) m_exename.getwinexe(m_hwnd 0)
ret this.m_exename
Similarly create more member functions.
Example macro that declares and uses the class:
class Exe m_hwnd -str'm_exename -str'm_exepath ;;and so on
Exe exe ;;declare variable of Exe class
exe.m_hwnd=_hwndqm ;;initialize. Alternatively, create member function eg Init that initializes the object.
out exe.name
This was just one of possible implementations. Maybe you need to get some properties every time the member function is called, instead of caching into member variables. Or get all properties in Exe.Init, which would simplify other member functions.