Two white and two black wires in ceiling box
Alright there are two options. 

1.Either your light was fed power from the panel (or a plug etc...) first.

OR


The light switch box was fed power first and your light has two cables in it because it goes to another light after that one.


You need to first figure out where your strait hot power is coming in from. I understand that you believe you have found it. Just make sure to double check. Like you say use just a basic light switch (not that dimmer) and test for hot again. Is that wire you believed was hot , still hot when you have the switch in an up and down position? I will give you both options for wiring below. If there is power in both the up and down position of your light switch, than that is the hot power.


If the light was fed power first than here is how you connect the wires. Take your black (hot all the time wire) and marrett it onto the white of the opposite cable (that brings hot power down to your switch). On the same cable (the white you just used that goes to your switch) put the black wire onto the light (under the copper looking screw). Now you have one white wire left (it goes back to your panel somehow or another) so attach that to your silver coloured screw on your light. Done. You have a path, the hot going thru your switch, coming back to the light as switched power, going through your bulb and back to your panel. 
If your hot wire feeds your light switch first. Heres how you wire it. Your switch box will be opened from testing and finding constant hot power in it so lets start there. Take your always hot black and put it on your light switch, than take the other black in that box and put it on the light switch. Take your white that is in the same cable as your always hot black and wire nut it with your other white. Now go up to your light box. Take the two blacks and wire nut them together with a pigtail. The pigtail will go to the copper coloured screw on your light. And take the whites and wire nut them together with a pigtail that you put on the silver looking screw on your light. Done. Power goes thru your switch, out of the switch to the light, thru the light and back on the white/neutral to the panel.


If you are using a light that you do not attach to screws you attach to wires, than the copper coloured screw is the equivalent of a black wire. And the silver coloured screw is the equivalent of a white wire. Your dimmer might be ruined but just try first with your basic switch and than add the dimmer in after to see if its ruined...

Have fun!