I use a "marker" word when they are doing something they aren't supposed to be doing. Like barking/whining. I say "UH OH" very loudly, turn and walk away and ignore them completely. If they come after me and proceed to bother me, paw at me, bark at me, etc., I continue to ignore them, turning around and walking away, into another room, etc.
I think using a marker word helps them to identify instantly what they did/are doing is wrong. I only use "UH OH" for things that are bad/things they need to stop- I don't tease them with the word, using it at other times.
And I totally agree, ignoring them can be very hard. But remember, even telling them to be quiet and/or speaking to them in any way is "rewarding" the behavior and to a dog, any attention is better than none.