06-22-2015, 07:44 PM
It may not have anything to do with the fact that the function I coded was being called by another function rather than a macro but the code does not seem to be able to execute "act w" and I have also seen a pointer error from the line "cloaked=(IsWindowCloaked(w))".
The code worked ok when called from a macro and not a function.
Here is the code for the function "actuncloak"
Macro Macro17
The code worked ok when called from a macro and not a function.
Here is the code for the function "actuncloak"
Macro Macro17
/
function str'chart int'&cloaked
int w=win(chart)
out "activating and uncloaking"
;tryagain
0.01
act w
err
,out "cannot activate window in actuncloak"
,goto tryagain
,
if win<>w or win=0
,out "trying to activate window in actuncloak again"
,goto tryagain
cloaked=(IsWindowCloaked(w))
int active(win=w) visible(IsWindowVisible(w))
out "active=%i visible=%i cloaked=%i" active visible cloaked
if cloaked
,cloaked=0
,if(DwmSetWindowAttribute(w 13 &cloaked 4))
,,out _s.dllerror ;;Try to uncloak. Error: Access is denied..
,,ret
ret