Using technology to get a graphical representation of functions requires the choice of a suitable viewing window. The literature suggests teachers' knowledge as being central in this process, but does not tell us much about how the teachers should manage this. This study aims to improve understanding about the teachers' choices related to the viewing window on the study of functions. It also intends to illustrate how this analysis can be a useful way to access aspects of teachers' knowledge based on the framework of Knowledge for Teaching Mathematics with Technology (KTMT). The study adopts a qualitative methodological approach, undertaking case studies of two teachers. The findings recognize the importance of carefully sequencing the students' contact with this kind of situation and the impact of the viewing window over the teachers' choices of tasks, pointing to the relevance of considering situations where the students actually face the difficulties. This highlights the relation of teachers' choices of viewing window to their knowledge of different KTMT's domains, and specifically the relevance of knowledge of different ways to change the window; of the difficulties faced by the students; of the most suitable tasks (and required viewing window) at each moment; of the impact of the viewing window on the appearance of a graph and of the different situations associated, from the mathematical point of view.