Always On Top Trick - Hints Hidden

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Phil Pendlebury
Automation Wizard
Posts: 518
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Always On Top Trick - Hints Hidden

Post by Phil Pendlebury » Fri Jul 08, 2022 7:15 am

Hi guys,

Using JRL's great trick to keep a compiled dialog always on top, (and using panels as buttons), I am finding that Hints are hidden behind the dialog.

Has anyone come across this previously?

Code: Select all

Show>Dialog1
Label>Loop
    Wait>0.01
    //The next four lines only needed for compiled scripts
    Let>WIN_USEHANDLE=1
      GetWindowPos>Dialog1.handle,Dialog1X,Dialog1Y
      MoveWindow>Dialog1.handle,Dialog1X,Dialog1Y
    Let>WIN_USEHANDLE=0
  Goto>Loop
Hints work fine when the dialog is set as always on top (using FormStyle = fsStayOnTop) and called with

Code: Select all

Show>Dialog1,resd
I guess this is a side effect of the way the trick works.
Phil Pendlebury - Linktree

User avatar
JRL
Automation Wizard
Posts: 3460
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Always On Top Trick - Hints Hidden

Post by JRL » Fri Jul 08, 2022 2:45 pm

I would try creating a flag variable that controls whether or not the dialog gets moved. Something Like:
(This has not been tested. Demonstration only.)

Code: Select all

//beginning of script
Let>vMoveDialogFlag=1
//lines of code
If>MoveDialogFlag=1
  GetWindowPos>MyDialog,DiaX,DiaY
  MoveWindow>MyDialog,DiaX,DiaY
EndIf
Set a couple of Dialog handlers for MyDialog for OnMouseEnter and OnMouseLeave that set the flag variable.

Code: Select all

Adddialoghandler>MyDialog,,OnMouseEnter,srtTurnOffDialogMove
Adddialoghandler>MyDialog,,OnMouseLeave,srtTurnOnDialogMove

SRT>srtTurnOffDialogMove
  Let>vMoveDialogFlag=0
END>srtTurnOffDialogMove

SRT>srtTurnOnDialogMove
  Let>vMoveDialogFlag=1
END>srtTurnOnDialogMove

User avatar
Phil Pendlebury
Automation Wizard
Posts: 518
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: Always On Top Trick - Hints Hidden

Post by Phil Pendlebury » Fri Jul 08, 2022 5:42 pm

Thanks JRL, great idea.
Phil Pendlebury - Linktree

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts