Let HP be a Hausdorff topological vector space with the underlying vector space H being a Hilbert space such that P is coarser than the norm topology. A densely defined P-P-continuous operator on H is called P-maximal if it has no non-trivial P-P-continuous extension, and it is said to be P-adjointable if its adjoint is also P-P-continuous.We show that if P is locally convex, the collection MP⋆(H) of all densely defined P-maximal P-adjointable operators is a ⁎-algebra under the multiplication given by the P-maximal extension of the composition and the involution ⋄ given by the P-maximal extension of the adjoint. Examples include rigged Hilbert spaces and O⁎-algebras.In the general (not necessarily locally convex) case, we associate with HP a ⁎-algebra Lb⋆(HP ˜) which is a ⁎-subalgebra of MP⋆(H) when P is locally convex. If P is the measure topology on H corresponding to a tracial von Neumann algebra M⊆L(H), then the image of the representation of the measurable operator algebra on the completion HP ˜ of H with respect to P, can be regarded as a ⁎-subalgebra of Lb⋆(HP ˜).In the case when P is normable, it is shown that Lb⋆(HP ˜) is a Banach ⁎-algebra. Examples of such Banach ⁎-algebras include LL∞[0,1]⋆(L2[0,1]):={Ψ∈B(L2[0,1]):Ψ(L∞[0,1])⊆L∞[0,1];Ψ⁎(L∞[0,1])⊆L∞[0,1]} (under a suitable norm) as well as LT(ℓ2)⋆(S(ℓ2)):={Φ∈B(S(ℓ2)):Φ(T(ℓ2))⊆T(ℓ2);Φ⁎(T(ℓ2))⊆T(ℓ2)}, where S(ℓ2) and T(ℓ2) are the spaces of Hilbert–Schmidt operators and of trace-class operators respectively, on ℓ2.