Re: Window focus



"Lindsay" <me@xxxxxxxx> wrote in message
news:42a6d953$0$32628$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have a form with no caption or border. Is there a way to know when the
>form receives and loses focus.

Top-level (frame) windows normally do not receive focus. A VB form is a
top-level window and I am nearly certain they don't receive focus either.
The only exception is when a window (form) does not have any children, such
as controls.

You will need to subclass the form. Then process the WM_ACTIVATE message for
the form. One of the VB experts might have an easier solution, but I think
that will do what you need.


.



Relevant Pages

  • WM_NCPAINT not properly handled in Vista after changing window style
    ... If I create a child window without a border, and later I want to let the user change its position by a border, I make the following changes: ... But the frame does not get updated, if a part of the frame is uncovered which was previously covered by another window. ... This overrides the update region and tells to repaint the entire nonclient area and frame. ...
    (microsoft.public.win32.programmer.ui)
  • Re: Need help solving a threading issue
    ... If the HWND is not a top-level owned window, you end up in trouble, because the ... the way CAsyncSocket gets its callbacks is to create a top-level invisible ... But having a thread create a child HWND, or a CDialog, or something like that, opens up ... David, AFAIK, it is perfectly fine to create HWNDs in a secondary thread, if ...
    (microsoft.public.vc.mfc)
  • Re: Remove Frame Border using createpopup();
    ... I made a popup window with createpopup. ... border around it that is grey. ... would not allow the frame of the popup to show. ...
    (comp.lang.javascript)
  • Re: Image does not fit correctly in a div frame
    ... Works well in IE8 except the frame has more space between it and the window ... The more serious problem is FireFox. ... Includes the border? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Questions about WM_POWERBROADCAST
    ... Is there a way to get power messages without being a top-level ... You can always create a hidden top-level window specifically for the ... purpose of watching broadcasts. ...
    (microsoft.public.vc.language)

Loading