Drawing icons (Window_Base)

I retrieve the icon index like this:

console.log($dataWeapons[1].iconIndex);But then I also have to store the info somehow. Like I have to store it like "You found a item[1]!" And then I have to cut the string into 2, put an icon in between and print it out on the window somehow. This must be build-in somewhere. How do I properly display the icon and the name of the item/weapon/armor/whatever on the window? Including knowing the offset for drawing additional text or lines.

I currently implemented it as an object with 3 variables (text1, iconindex, text2) and when drawing I manually calculate the positions of the text with measureTextWidth() and such. It works but it looks so messy.
does drawIcon not work?
I may be a little confused. 
Do you mean drawing the icon inside the message boxes?
I'd like to draw text in Window_Base (not a message window) and align the icons perfectly between the text-lines.

Perhaps I should inherit from Window_Message. But the drawing of the text is gonna be custom anyway.

draw_icon works. I even have icons, but it's messy:

whatigotnow.png


http://s22.postimg.org/6h2pqt2w1/whatigotnow.png

I have it working. But I wrote so much custom code. I'd rather just like to say draw_text_with_icons("Looted 6x item[1] Potion"); and the game will just draw me the text with an icon in between, perfectly aligned/scaled and all.
You can insert \I[50] and it will insert an icon with index 50 into the text.
 

file:///C:/Program%20Files/Steam/steamapps/common/RPG%20Maker%20MV/Help/index.html

scroll down to eevent commands > messages and it has the list

Original thread: https://forums.rpgmakerweb.com/threads/drawing-icons-window_base.49160/