Whenever I plug my iPhone into my computer I get the message below.
Now the phone is plugged into a hug which goes to my computer. Sometimes when you plug something into a hub say a printer it won't work correctly.
I actually had that happen to me once and I had to do some major reworking of what cord was going into what outlet. Took me a good fifteen minutes until everything was up and working.
The first time I saw this I thought can't charge the phone when connected to the computer. No problem there just plug it into an outlet. Here's the thing. I walked away leaving the phone plugged in. I had something else to do. When I'd plugged it in to download pictures the battery was at about 50%. A couple hours later I was heading out and got my phone. Turns out it was completely charged by that time.
So I'm not entirely sure why this dialog box appears on my computer screen when in fact the phone is being charged. Not that I mind it but seems a bit odd to me. Then again lots of things Apple has done lately has seemed a bit odd.