You need to call GetDlgCtrlID from outside the activex control as the
function available within the control returns an arbitrary value of zero.
Take a look at this article
particularly the paragraph preceeding the title "MFC and Ambient
Properties". This really begs the question why you want the ID in the first
place as activex controls have to be fully self containing to operate - with
a few exceptions where sibling controls need to be able to locate each
"ytv" <firstname.lastname@example.org> wrote in message
> GetWindowLong return 0.