Results 1 to 4 of 4

Thread: Cannot work with hwnd property

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Angry

    Hello guys!
    I am making an activex control that uses a window API call to set the form, on which this activex control is, to always be on top or not.
    When I work with this window API in standard EXE project then it works fine. That looks like this.

    SetWindowPos form1.hwnd, HWND_TOPMOST, 0, 0, 0, _ 0, TOPMOST_FLAGS

    In this code I am making the "form1" on top of other windows.

    In my activex control. I want to use the form on which this activex control is. I have tried this:

    SetWindowPos Me, HWND_TOPMOST, 0, 0, 0, 0, _
    TOPMOST_FLAGS

    It return an error.
    How can it be done??
    Baaaaaaaaah

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898
    I think on the activeX by referencing ME you end up referencing the control itself which is why it errors.

    The way I see it is to declare a property of type form and set it to the parent. then use the property as the value in the API.

    Have you tried to use the Zorder this usually does it as well.

  3. #3

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Thumbs up That is perfect BUT

    That is perfect but I don't no how to declare the types of form.
    If you can give me the source code then I would really appreciate.
    Thanks again!
    Baaaaaaaaah

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    How about using: UserControl.hWnd?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width