Sign in to follow this  
Followers 0
1905russell

How do I fix Gui postion on scrolling page

6 posts in this topic

I know I should be working on tax returns but I have a problem that I can’t seem to find the answer to.

Problem - Let’s say I’m in notepad (or acrobat or word) and I have a Gui created on line one. How do I attach the gui so that if I scroll notepad down the Gui will disappear (up into cyberspace) and then when I scroll notepad up again it will reappear when line one reappears. Is there a style that can facilitate this automatically? To recap - I want the Gui to remain in a fixed position on the page no matter what page it’s on and then move with the page and disappear and reappear on scrolling. Can someone point me in the right direction or give me a hint on how to approach this please?

Share this post


Link to post
Share on other sites



I know I should be working on tax returns but I have a problem that I can’t seem to find the answer to.

Problem - Let’s say I’m in notepad (or acrobat or word) and I have a Gui created on line one. How do I attach the gui so that if I scroll notepad down the Gui will disappear (up into cyberspace) and then when I scroll notepad up again it will reappear when line one reappears. Is there a style that can facilitate this automatically? To recap - I want the Gui to remain in a fixed position on the page no matter what page it’s on and then move with the page and disappear and reappear on scrolling. Can someone point me in the right direction or give me a hint on how to approach this please?

"a Gui created on line one"

Can you show us how you did that to start with?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

"a Gui created on line one"

Can you show us how you did that to start with?

Here is a mock up for discussion purposes. I really should be doing tax returns.

#include <GuiconstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}", "On_Exit")
Func On_Exit()
    Exit
EndFunc   ;==>On_Exit

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("{ENTER 50}")
Send("^{HOME}")
Send("This is line one")
Send("{END}")
Send("  ")
$a = WinGetCaretPos()
$hGUI = GUICreate("hGUI", 150, 15, $a[0], $a[1], BitOR($WS_POPUP, $WS_BORDER))
$hInputCtl = GUICtrlCreateInput("", 0, 0, 150, 15)
GUICtrlSetState(-1, $GUI_SHOW)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Edited by 1905russell

Share this post


Link to post
Share on other sites

Those tax returns won't go anywhere -- they'll patiently wait for you to come back to them. :(

You're trying to embed an AutoIt GUI application on the display of another GUI, aren't you? It would be nifty if that were possible.

Share this post


Link to post
Share on other sites

You're trying to embed an AutoIt GUI application on the display of another GUI, aren't you? It would be nifty if that were possible.

Anygui can do that

Share this post


Link to post
Share on other sites

@Fubarale - thanks – I don’t know if that’s what I’m trying to do? You tell me? Apparently it is possible.

@picaxe thanks for answering Furable but alas I guess my question remains unanswered.

In between tax returns I took a look at Anygui and I adjusted ANYGUI_Example_Notepad2.au3 to again illustrate my question.

How do I track the position of the Gui when I scroll the target?

#include <ANYGUIv2.8.au3>
Run("notepad.exe")
Sleep(1000)
Send("{ENTER 100}")
Send("^{HOME}")
Send("This is line one")
;WinSetState("Untitled - Notepad", "", @SW_SHOW )
$targetctl = _GuiTarget ("Untitled - Notepad", 1, "", 15)
$btnhide = _TargetAddButton("Hide", 300,400, 100, 100,-1,-1, $targetctl)
GUISetState(@SW_SHOW)
$btnshow = _TargetAddButton("Show", 400,400, 100, 100,-1,-1, $targetctl)
GUISetState(@SW_SHOW)
$mydraglist = _TargetAddDraglist ("", 50, 60, 250, 100, $WS_VSCROLL, -1, $targetctl);
GUICtrlSetData($mydraglist[0], "you|me|them|us|cool|stuff|maynerd|damn|crazy|wow|whatup|yada|nada|oh yeah")
;$mycheckbox1[0] is controlid: $mycheckbox1[1] is control hwnd: $mycheckbox1[2] is child window
GUISetState(@SW_SHOW)
While 1
 $msg = GUIGetMsg()
 Select
  Case $msg = $btnhide[0]
 GUISetState(@SW_HIDE, $mydraglist[2])
     Case $msg = $btnshow[0]
 GUISetState(@SW_SHOW, $mydraglist[2])
  Case $msg = $GUI_EVENT_CLOSE
   Exit
  Case Not WinExists($targetctl)
   Exit
 EndSelect
WEnd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0