Instead of storing the window pointers in a vector, store them in the list. Mouse testing is then done from top to bottom, and drawing is done from bottom to top. Moving a window to the top requires that the window be removed and added to the front of the list.
On an unrelated note, the code you posted is somewhat hard to follow because of all the nested code blocks. Try to make it more flat. For example,if(!WindowList[i]->WindowItemList[itemnum]->GetActive()){continue;}else{/*do stuff*/}is equivalent toif(!WindowList[i]->WindowItemList[itemnum]->GetActive()) continue;/*do stuff*/
Thank you so much for your answer
edit: I got it working thanks to you

Find content
Not Telling