Have A Transparent Window In PowerBuilder
External Function Declaration
1 2 3 4 5 | //[External Function Declaration] Function Long GetWindowLong (ULong hWnd, Int nIndex) Library "USER32.DLL" Alias For "GetWindowLongA" Function Long SetWindowLong (ULong hWnd, Int nIndex, Long dwNewLong) Library "USER32.DLL" Alias For "SetWindowLongA" //W2K or better Function Long SetLayeredWindowAttributes (Long hWnd, Long crKey , Char bAlpha , Long dwFlags) Library "USER32.DLL" |
PowerScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | //[powerscript] Constant Long LWA_COLORKEY = 1, LWA_ALPHA = 2 Constant Long GWL_EXSTYLE = - 20 Constant Long WS_EX_LAYERED = 524288 //2^19 Long ll_Ret, ll_handle // or-bitwise function OleObject wsh wsh = Create OleObject wsh.ConnectToNewObject( "MSScriptControl.ScriptControl" ) wsh.language = "vbscript" ll_handle = Handle (This) // handle of the window ll_Ret = GetWindowLong(ll_handle, GWL_EXSTYLE) ll_Ret = wsh.Eval(String(ll_Ret) + " or " + String(WS_EX_LAYERED)) SetWindowLong (ll_handle, GWL_EXSTYLE, ll_Ret) // Set the opacity of the layered window to 128 (transparent) SetLayeredWindowAttributes (ll_handle, 0, Char(128),LWA_ALPHA) // Set the opacity of the layered window to 255 (opaque) // SetLayeredWindowAttributes (ll_handle, 0, char(255),LWA_ALPHA) |
Good Luck!