use getcmdwintype()