• mouse

    From aurora baccio@21:1/5 to All on Mon Nov 22 05:01:35 2021
    Good morning,
    I have a question and I explain why.
    I am convinced that the episodic failure of a medical application depends on the fact that the secretaries continue to press the mouse button even though there is a warning of printing in progress or because they think that pressing the button will speed
    up the procedure. I have disabled the 'okay' keys for this very reason and re-enable them at the end of the printing procedure. But every now and then something happens. And always in the printing process. And there is no logical reason for the error. It
    simply freezes the pc.
    Is there any way to disable the mouse and then re-enable it ?
    If possible an example.
    Thanks for the help.
    Aurora Baccio

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolfgang Riedmann@21:1/5 to aurora baccio on Tue Nov 23 08:06:12 2021
    Hi Aurora,

    IMHO this is not possible without administration rights, and even with
    that you risk that the mouse does not return reponsive immediatly after enabling it.

    Wolfgang

    aurora baccio wrote:

    Good morning,
    I have a question and I explain why.
    I am convinced that the episodic failure of a medical application
    depends on the fact that the secretaries continue to press the mouse
    button even though there is a warning of printing in progress or
    because they think that pressing the button will speed up the
    procedure. I have disabled the 'okay' keys for this very reason and
    re-enable them at the end of the printing procedure. But every now
    and then something happens. And always in the printing process. And
    there is no logical reason for the error. It simply freezes the pc.
    Is there any way to disable the mouse and then re-enable it ? If
    possible an example. Thanks for the help. Aurora Baccio



    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alessandro Vacchiano@21:1/5 to All on Tue Nov 23 06:32:35 2021
    Try to use before start to print (first line) :

    LockWindowUpdate(self:Handle()) // self is the window

    <your code>

    LockWindowUpdate(null_ptr)

    look on win api documentation this stop any dispatch to the window

    Bye Alessandro.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jamal@21:1/5 to aurora baccio on Wed Nov 24 14:37:35 2021
    Aurora,

    You cannot blame this on the user in a desktop application!

    If it were was a web application, then I would say that it is possible
    that a user clicks a button more than once, causing multiple execution
    of same methods; even then there ways to prevent that.

    Going back to your issue, you may add a flag variable to indicate that
    printing is in progress:

    For example:

    In your print method,

    IF !SELF:lPrinting
    SELF:lPrinting := TRUE
    ELSE
    RETURN NIL //
    ENDIF

    // handle your printing

    // Finished printing
    SELF:lPrinting = FALSE

    RETURN NIL

    If after you implement something similar to the above and you still have
    the same PC freeze issue, then you need to look deeper at your code
    logic or other factors like networking.

    Jamal

    On 11/22/2021 8:01 AM, aurora baccio wrote:
    Good morning,
    I have a question and I explain why.
    I am convinced that the episodic failure of a medical application depends on the fact that the secretaries continue to press the mouse button even though there is a warning of printing in progress or because they think that pressing the button will
    speed up the procedure. I have disabled the 'okay' keys for this very reason and re-enable them at the end of the printing procedure. But every now and then something happens. And always in the printing process. And there is no logical reason for the
    error. It simply freezes the pc.
    Is there any way to disable the mouse and then re-enable it ?
    If possible an example.
    Thanks for the help.
    Aurora Baccio


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)