A variety of novel pyrimidopyridoquinazoline, pyrazoloquinoline, and thiazoloquinoline derivatives were synthesized starting from 2,5,7-triamino-4-(4-methoxyphenyl)quinoline-3,8-dicarbonitrile under conventional heating. The same products were also prepared under microwave irradiation to improve the yield and time of the reactions. The structures of all newly synthesized compounds were proved by elemental analysis and IR, H-1 and C-13 NMR spectroscopy and mass spectrometry. The products were screened for their in vitro antimicrobial activity and showed moderate to high activity. They were also evaluated for anticancer activity against the HePG-2, HCT-116, and MCF-7 cell lines. Molecular docking was used to explore the molecular mechanism of the anticancer activity of 6-(4-methoxyphenyl)-3,9-dihydrodipyrazolo[3,4-b:3',4'-h]quinoline-1,5,7-triamine, which showed the highest cytotoxicity against all the test tested cancer cell lines.