code:
function MakeWndTransparent(hWnd, lTransparencyLevel){
var nMsg = Interop.Allocate(4);
var GWL_STYLE = (-20);
var LWA_ALPHA = 0x2;
var WS_EX_LAYERED = 0x80000;
var WS_EX_TRANSPARENT = 0x20;
nMsg.WriteDWORD(0, Interop.Call('user32', 'GetWindowLongW', hWnd, GWL_STYLE); | WS_EX_LAYERED);
Interop.Call('user32', 'SetWindowLongW', hWnd, GWL_STYLE, nMsg.ReadDWORD(0));
Interop.Call('user32', 'SetLayeredWindowAttributes', hWnd, 0, lTransparencyLevel, LWA_ALPHA);
}
I just read your post, you want to hide the window, well your code was to try set the Transparency level. To hide and show a window you can use this:
code:
/* function : _hide | hides the window */
function _hide(hWnd){
var SW_HIDE = 0;
Interop.Call('user32', 'ShowWindow', hWnd, SW_HIDE);
}
/* function : _show | shows the window */
function _show(hWnd){
var SW_SHOW = 5;
Interop.Call('user32', 'ShowWindow', hWnd, SW_SHOW);
}