Can you tell me what's wrong in my code ?

Can you tell me what's wrong in my code ?

https://github.com/tothpaul/Delphi/tree/master/NoFocusForm

Thanks
https://github.com/tothpaul/Delphi/tree/master/NoFocusForm

Comments

  1. You made it a child window, so it gets clipped

    ReplyDelete
  2. David Heffernan I know, but the dotNet code do that also !

    protected override CreateParams CreateParams
    {
    get
    {
    CreateParams ret = base.CreateParams;
    ret.Style = (int)Flags.WindowStyles.WS_THICKFRAME | (int)Flags.WindowStyles.WS_CHILD;
    ret.ExStyle |= (int)Flags.WindowStyles.WS_EX_NOACTIVATE | (int)Flags.WindowStyles.WS_EX_TOOLWINDOW;
    ret.X = this.Location.X;
    ret.Y = this.Location.Y;
    return ret;
    }
    }

    ReplyDelete
  3. So what else is different. I've not looked at the .net code. What is the parent window set to?

    ReplyDelete
  4. David Heffernan none, but I wonder if it's has something to do with PopupMode property that do set a ParentWindow even when the form has no Parent control....i've tried many things and can figure what is different between the 2 projects...that's why I ask and provide a sample code. BTW I'm not a dotNet expert at all.

    ReplyDelete
  5. Debug the .net code and see what value WndParent has in that CreateParams

    ReplyDelete
  6. David Heffernan 0, and that's weird because if I force WndParent to 0 with the WS_CHILD flag, I have an error on CreateWindowEx ERROR_TLW_WITH_WSCHILD

    ReplyDelete
  7. I have successfully made a satisfied (meaning the parent form keeps the focus) drop down form with the technique posted here: http://stackoverflow.com/a/29553376/133516}

    ReplyDelete
  8. Edwin Yip yes, I've seen that, but when I add that, the buttons do not click anymore :/

    ReplyDelete

Post a Comment