WM_NCHITTEST 16bit app in Win95 vs 3.1

WM_NCHITTEST 16bit app in Win95 vs 3.1

Post by Roger » Wed, 28 Oct 1998 04:00:00



Hello everybody,

I am trying to implement a 16 bit status bar class for dialogs like the one in
32 bits. The obvious thing of returning HTBOTTOMRIGHT from the control when the
cursor is in the sizegrip works fine if the app is runiing under Win95 or NT4,
but under Win 3.1 the control is resized, not the dialog.

I subclassed the dialog procedure. It does not receive WM_NCHITTEST when the
cursor is in a control so I tried returning HTBOTTOMRIGHT when the mouse was
not on a control. I was unable to make the dialog resize that way, or by
adjusting lParam so the system would think that the mouse was on the border. In
fact returning HTBOTTOMRIGHT in the subcless procedure prevents the sizing
cursor from being shown. I can only assume that the system has looked at the
message before the subclass procedure is called. This behaviour is the same
under Win3.1, 95 and NT4.

I also tried putting the user control in the dialog template instead of
creating it on the fly with CreateWindow(), but this made no difference.

Anyone got any ideas please?

Roger Abbott,
RHA (Minisystems) Ltd.
http://www.angelfire.com/biz/rhaminisys
Windows shareware, DDE tools, Algol60

 
 
 

WM_NCHITTEST 16bit app in Win95 vs 3.1

Post by Roger » Thu, 05 Nov 1998 04:00:00



Quote:(RogerHA) writes:
> am trying to implement a 16 bit status bar class for dialogs like the one in
>32 bits. The obvious thing of returning HTBOTTOMRIGHT from the control when
>the
>cursor is in the sizegrip works fine if the app is runiing under Win95 or
>NT4,
>but under Win 3.1 the control is resized, not the dialog.

>I subclassed the dialog procedure. It does not receive WM_NCHITTEST when the
>cursor is in a control so I tried returning HTBOTTOMRIGHT when the mouse was
>not on a control. I was unable to make the dialog resize that way, or by
>adjusting lParam so the system would think that the mouse was on the border.
>In
>fact returning HTBOTTOMRIGHT in the subcless procedure prevents the sizing
>cursor from being shown. I can only assume that the system has looked at the
>message before the subclass procedure is called. This behaviour is the same
>under Win3.1, 95 and NT4.

>I also tried putting the user control in the dialog template instead of
>creating it on the fly with CreateWindow(), but this made no difference.

I have got this to work. There are two key tricks -

(1)  The status bar bar must draw in the dialog client area, not one of its
own. This is so that the parent dialog procedure gets the WM_NCHITTEST messages
and not the contol. But the control must have a visible widow, so it is one
pixel in a corner away from the sizegrip.

(2)  Subclassing the dialog procedure to get the WM_NCHITTEST messages does not
work. What you must do is provide a new class procedure for the dialog and
process the WM_NCHITTEST there.

If anyone is interested I will put the code on the web site.

Roger Abbott,
RHA (Minisystems) Ltd.
http://www.angelfire.com/biz/rhaminisys
Windows shareware, DDE tools, Algol60

 
 
 

1. COM Add-in vs. Automation vs. Word Add-ins vs...

Hello Folks,

I am hoping that some learned person out-there in the COM-aware
community can clear-up this... nebulousness, for me.

I am about to begin a project which would traditionally be known as
a "Word Add-in". I am using VC++ 6 and Word2000.

In past such projects we used the old CAPI, and the "Word Add-in"
(a.k.a. .wll) would be loaded by Word upon startup by virtue of it's
existence in Word's "Startup" folder, and began it's life in the  'C'
wdAutoOpen() call. The old application became

- Does "Automation" (formerly "OLE Automation") imply that the Client
  (myClient.dll) launches and commands the Server (in this case Word)?
  How does Automation differ from a COM Add-in?

- Is the "COM Add-in" the right way to go for extending Word's
functionality?

- What are the implied benefits of using a COM Add-in to implement MS
  Word extensions over other methods of doing so?

Any info concerning the above would be much appreciated indeed!

Thanks.

--
Sean

======================
         Sean C. Murphy
    Sr. Software Engineer
      Document.Com, Inc.
       617.542.7200 X232

======================

2. 1.44 vs 1.60 MB 3.5 formatting

3. GetFocus() in Win95 vs. 3.1

4. Fudging localclock time2 (newbie question)

5. Timers under Win95 vs. 3.1

6. THE OLE SERVER ISNT REGISTERED, TO REGISTER THE OLE SERVER REINSTALL IT

7. Timers under Win95 vs Win 3.1

8. using windows authentication for mysql server

9. 3.1 apps in Win95?

10. Porting 3.1 apps to Win95 / NT ?

11. Fullscreen 16bit app under win95

12. Q. Difference between 16bit Vs 32bit OS/Apps?

13. Debugging VC 1.5 (16bit) app under Win95