Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11895

Re: Stop a window from moving

From "Karl-Heinz" <invalid@invalid.invalid>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Stop a window from moving
Date 2018-09-09 11:42 +0200
Message-ID <fvk8c1FiqtsU1@mid.individual.net> (permalink)
References (2 earlier) <bc3f0565-c590-45a6-80b1-caa117a988a6@googlegroups.com> <pmt2vi$1b0$1@dont-email.me> <6e3e86ab-8501-481a-a837-62e21cfa1a68@googlegroups.com> <fvf310Fh504U1@mid.individual.net> <8f794fca-c9a6-4fd4-a6bf-0c42c2c22cad@googlegroups.com>

Show all headers | View raw


Hi Jeff,

>
> now the X etc in the top right corner is back
>


1. I think the best way is to remove the systemmenu of the Datawindow
completly. So, remove at first all current  calls concerning the "menu"
from your PostInit().

Then add these two lines:

   SELF:EnableSystemMenu(FALSE)
   SELF:EnableBorder(WINDOWNONSIZINGBORDER)



2. This method is needed that you can´t move the window, and that you can´t
close the datawindow with ALT+F4

METHOD Dispatch ( oEvent ) CLASS <yourwindow>
DO CASE

CASE oEvent:message == WM_NCLBUTTONDOWN

    IF oEvent:wparam == HTCAPTION

        // prevent a window move

        RETURN SELF:eventreturnvalue := 1L

    ENDIF


CASE oEvent:message == WM_SYSCOMMAND

    // prevent ALT + F4 closes the window

    IF oEvent:wparam == SC_CLOSE

        RETURN SELF:eventreturnvalue := 1L

    ENDIF


ENDCASE

RETURN SUPER:Dispatch ( oEvent )


3. Now it´s up to you to call EndWindow() somewhere in your Datawindow code,
otherwise the taskmanager will be your friend :-)

regards
Karl-Heinz 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 03:53 -0700
  Re: Stop a window from moving JohnMartens <martens@tennishulp.info> - 2018-09-06 15:08 +0200
    Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 06:30 -0700
      Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 06:38 -0700
        Re: Stop a window from moving Leo_Bond <l.bond@bk.ru> - 2018-09-06 06:58 -0700
          Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 15:42 -0700
    Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 18:54 -0700
      Re: Stop a window from moving JohnMartens <martens@tennishulp.info> - 2018-09-07 07:40 +0200
        Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-06 23:23 -0700
          Re: Stop a window from moving JohnMartens <martens@tennishulp.info> - 2018-09-07 12:27 +0200
          Re: Stop a window from moving "Karl-Heinz" <invalid@invalid.invalid> - 2018-09-07 12:38 +0200
            Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-07 17:36 -0700
              Re: Stop a window from moving "Karl-Heinz" <invalid@invalid.invalid> - 2018-09-09 11:42 +0200
                Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-09 06:27 -0700
                Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-09 06:34 -0700
                Re: Stop a window from moving "Karl-Heinz" <invalid@invalid.invalid> - 2018-09-10 07:37 +0200
                Re: Stop a window from moving Jeff Rollo <jrollo64@gmail.com> - 2018-09-09 23:31 -0700

csiph-web