    'SetClassLongPtr / SetWindowLongPtr
     
    $ filename "window_click2.exe"
     
    'uses rtl32
    'uses rtl64
     
    uses WinUtil
     
    % GCL_STYLE = -26
     
     
    MainWindow 310,250,WS_OVERLAPPEDWINDOW
     
     
    function WndProc(sys hwnd, Msg, wParam, lParam) as sys callback
     
        select Msg
        
            case WM_CREATE
                'Replaces the window-class style bits    
                SetClassLongPtr(hwnd, GCL_STYLE, GetClassLongPtr(hwnd, GCL_STYLE) | CS_DBLCLKS)
     
                'Change attributes of window
                SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED)
                int WindowOpacity = (255 * 70) / 100
                SetLayeredWindowAttributes(hwnd, 0, WindowOpacity, LWA_ALPHA)
     
     
            case WM_LBUTTONDOWN
                SetWindowText(hwnd, "Left Button Down")
            case WM_LBUTTONUP
                SetWindowText(hwnd, "Left Button Up")
            case WM_LBUTTONDBLCLK
                SetWindowText(hwnd, "Left Button Double Click")
     
            case WM_RBUTTONDOWN
                SetWindowText(hwnd, "Right Button Down")
            case WM_RBUTTONUP
                SetWindowText(hwnd, "Right Button Up")
            case WM_RBUTTONDBLCLK
                SetWindowText(hwnd, "Right Button Double Click")
        
            case WM_CLOSE
                DestroyWindow(hwnd)
            
            case WM_DESTROY
                PostQuitMessage(0)
            
            case else
                return DefWindowProc(hwnd, Msg, wParam, lParam)
                
        end select
        
        return 0
    end function
     