sendMessage :: [Attrib] -> HWND -> Exp Int -> Exp a -> Exp b -> Action (Exp Int)
sendMessage as a b c d = do
    v <- var
    Value a <- a
    Value b <- b
    Value c <- c
    Value d <- d
    as <- return $ foldl f Nothing as
    emit $ SendMessage a b c d v as
    return $ return $ Value $ val v
    where
        f c (Timeout x) = Just x
        f c x = error $ "Invalid attribute to sendMessage: " ++ show x
sendMessage :: [Attrib] -> HWND -> Exp Int -> Exp a -> Exp b -> Action (Exp Int)
sendMessage as a b c d = do
    v <- var
    Value a <- a
    Value b <- b
    Value c <- c
    Value d <- d
    as <- return $ foldl f Nothing as
    emit $ SendMessage a b c d v as
    return $ return $ Value $ val v
    where
        f c (Timeout x) = Just x
        f c x = error $ "Invalid attribute to sendMessage: " ++ show x
sendMessage as a b c d = do
    v <- var
    Value a <- a
    Value b <- b
    Value c <- c
    Value d <- d
    as <- return $ foldl f Nothing as
    emit $ SendMessage a b c d v as
    return $ return $ Value $ val v
    where
        f c (Timeout x) = Just x
        f c x = error $ "Invalid attribute to sendMessage: " ++ show x