All Things WinBatch > WinBatch

Mouse Click Issue

(1/4) > >>

I have a weird problem. 

I have an open Dialog which opens a Sub-Dialog using the Dialog(SubDialog) function.   Functionally it works fine.   When it opens I can tab down through the controls, press enter and activate the default button, etc.   What I cannot do though is click on any thing.  If I press Alt+Tab changing windows and then Alt+Tab back or manually change focus in some fashion back to this SubDialog then I can click as expected. 

Just had a thought and tried calling the Sub-Dialog from a PushButton and it works as it should.   Currently I am calling it by right-clicking on a control in the Timer Event.   I have tried disabling the Timer if it meets the necessary criteria as well as disabling the main dialog but that doesn't seem to make a difference.   Here is the code in the Timer Event.

--- Code: Winbatch ---    wga = WinGetActive()
    cf  = DialogControlState(MME_Handle, "rv_MMe_report", @dcsGetFocus, 0)
    mi  = MouseInfo(4)
    If wga == "Menu Example" && mi == 1 && cf == "rv_MMe_report" Then
  ;   DialogProcOptions(MMe_Handle, @deTimer,0)                             ; TimerEvent (0- Off).
  ;    DialogProcOptions(MMe_Handle, @dpoDisable,2)                         ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
  ;    DialogProcOptions(MMe_Handle, @dpoDisable,0)                         ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
  ;   DialogProcOptions(MMe_Handle, @deTimer,100)                           ; TimerEvent (0- Off).

Suggestions?    Thanks.


A bit more info.  It seems that something with the "If" statement causes the problem.   If I comment out the "If" statement it works.   If I change the code and set a flag and call Dialog outside the Timer Event after shutting off the Timer the same problem happens, if I call the Dialog within an "If" statement.


quickie snap-look makes me wonder what would happen if you left the THEN off the IF statement.  I don't think it's required.  You probably already considered this.

Thanks but no difference.   I tried a While statement as well.   Same behavior.


The description of the problem matches some but not all of the symptoms of a mouse capture issue but WinBatch doesn't ever attempt to capture the mouse. So it doesn't make a lot of sense as an explanation.

Also, note that the Dialog function will automatically disable a WIL dialog when the Dialog function is called from the WIL dialog's UDC.


[0] Message Index

[#] Next page

Go to full version