Concerning Shakespeare's Hamlet, in short, King Claudius manipulates the characters you ask about in the following ways:
- He gets Gertrude to marry him and, thus, gets the crown. He also manages to keep Gertrude viewing Hamlet on his terms and from his point of view for most of the play: at least until the bed chamber scene in Act 3.4, and possibly until the final scene in the play when she realizes Claudius has poisoned the cup meant for Hamlet. Gertrude is constantly on Claudius's side and perceives every issue that concerns Hamlet from the same point of view as Claudius (that Hamlet should shake off his sadness, that he should stay at Elsinore and not go back to school, that Hamlet may be "mad" because he is in love with Ophelia).
- Claudius gets Ros. and Guil. to spy on Hamlet for him. He turns them from being Hamlet's friends to his own agents. He summons them to Elsinore for this purpose and uses them for it. He repeatedly sends them on errands to Hamlet: to find out what's bothering him, for example, and to find out where Polonius's body is.
- Claudius redirects Laertes's wrath over the death of Polonius away from himself and toward Hamlet. He leads Laertes to think that he is helping him kill Hamlet for Laertes's sake, when in reality he is helping Laertes in order to protect his own crown.
Concerning Hamlet, however, Claudius attempts to manipulate Hamlet, but it doesn't work out in his favor. Claudius thinks he is playing a cat-and-mouse game with Hamlet, and he is--the only trouble is that Hamlet is the cat, not Claudius.
Notice how much time and effort Claudius spends trying to figure out why Hamlet is "mad." This is by design--Hamlet's design. He tells Horatio that he will be putting on an "antic disposition" (Act 1.5.171)--pretending to be mad. This is a diversion designed by Hamlet. And it works. Claudius spends all his time trying to figure out why Hamlet is insane, and never figures out--until Hamlet wants him to--that Hamlet knows about Claudius's murder of King Hamlet.
Only when Hamlet gets what he considers to be proof or confirmation that the Ghost is telling him the truth and that Claudius is guilty (by watching Claudius's reaction to the murder scene in the play-within-the-play) does Claudius know Hamlet knows. And notice what Hamlet tells Claudius the name of the play is--The Mousetrap. Claudius doesn't manipulate Hamlet; Hamlet manipulates Claudius. Hamlet is the cat.