Questions for the pros

Started by
17 comments, last by Xtreme 23 years, 9 months ago
Extreme, I don't know if this works but you can give it a try:
        case WM_NCHITTEST:{  LRESULT lResult = DefWindowProc(.....);  if (lResult==HT_CLOSE)  { DestroyWindow(hWnd);  }  return lResult;}        


You can also make a window without a border and do a DestroyWindow on a WM_KEYUP with VK_ESCAPE...


(ps: calling PostQuitMessage(0) will work, but is not so nice. Better to call DestroyWindow(hWnd), then do the PostQuitMessage(0) in the WM_DESTROY)



Edited by - baskuenen on July 18, 2000 12:44:15 AM
Advertisement
thanx Serge. that one is even better and is shorter to write


sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
baskuenen the code u wrote doesn''t work properly.
as soon as i run the program it quits! i tried postquitmessage
instead of destroy window and that didnt work either
by the way, its HTCLOSE...

sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
u forgot the "break" of the switch case probably --> it runs in the next case
i should''ve known! thanx but instead of clicking the close button, the program quits when the mouse goes over it....

sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
To stop a window from moving, overriding the default handler for WM_MOVING does work, but slightly different:

Instead of just returning NULL, you should set the values of the rectangle in lParam to those of the current window-rectangle...

Hope this works for your program.

Greetings, CondorWitte

Regarding Q2, Isn''t the scissor test usable here?
yes it is Anon. See above.

sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
i understand what you mean there CondorWitte but the window might wove a bit before it goes back to its position. What i want is like when you right click your mouse on that application you see options such as "restore, maximise, minise, move" etc.
Now if I use SYS_MENU when setting up my menu, I can see that the Maximum & Minimum options are disabled, but Move option isn''t! I want to know what command disables the "MOVE" option from the menu.

sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet

This topic is closed to new replies.

Advertisement