Jump to content

GUI Questions


James
 Share

Recommended Posts

This might be what you want. The "meat" is immediately below followed by it in context.

$pos = WinGetPos("Untitled - Notepad")
    $x = $pos[0] + $pos[2] - 200
    $y = $pos[1] +5
    $w = $pos[2] 
    $h = $pos[3] 
    MsgBox(0, "Active window stats (x,y,width,height):", $pos[0] & " " & $pos[1] & " " & $pos[2] & " " & $pos[3])
    WinSetOnTop($sGUI, "", 1)
    WinMove("WinBar App", "", $x, $y)  oÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíÕ¥
½¹ÍѹÑ̹ÔÌÐì(9½QÉå%½¸((((ÀÌØíÍU$ôÕ¥
ÉÑ ÅÕ½Ðí]¥¹    ÈÁÀÅÕ½Ðì°ÄÀÀ°ÈÀ°ÄÀÀ°ÄÀÀ°    ¥Ñ=H ÀÌØí]M}A=AU@°ÀÌØí]M}a}Q=A5=MP¤°ÀÌØí]M}a}Q==1]%9=¤(ÀÌØíÍ%¹ÁÕÐôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°´Ä°´Ä°ÄÀÈ°ÈȤ()Õ¥MÑMÑÑ ¤()]¡¥±Ä(]¥¹¥à ¤(ÀÌØí¹5ÍôU%Ñ5Í ¤(MÝ¥Ñ ÀÌØí¹5Í(
ÍÀÌØíU%}Y9Q}
1=M(á¥Ð(
ÍÀÌØíÍ%¹ÁÕÐ(ÀÌØíÍIôÕ¥
ÑɱI ÀÌØíÍ%¹ÁÕФ(Q½¼ ¤(¹MÝ¥Ñ )]¹()Õ¹]¥¹¥à ¤($ÀÌØíÁ½Ìô]¥¹ÑA½Ì ÅÕ½ÐíU¹Ñ¥Ñ±´9½ÑÁÅÕ½Ðì¤($ÀÌØíàôÀÌØíÁ½ÍlÁt¬ÀÌØíÁ½ÍlÉt´ÈÀÀ($ÀÌØíäôÀÌØíÁ½ÍlÅt¬Ô($ÀÌØíÜôÀÌØíÁ½ÍlÉt($ÀÌØí ôÀÌØíÁ½ÍlÍt(%5Í    ½à À°ÅÕ½ÐíÑ¥ÙÝ¥¹½ÜÍÑÑÌ¡à±ä±Ý¥Ñ ±¡¥¡Ð¤èÅÕ½Ðì°ÀÌØíÁ½ÍlÁtµÀìÅÕ½ÐìÅÕ½ÐìµÀìÀÌØíÁ½ÍlÅtµÀìÅÕ½ÐìÅÕ½ÐìµÀìÀÌØíÁ½ÍlÉtµÀìÅÕ½ÐìÅÕ½ÐìµÀìÀÌØíÁ½ÍlÍt¤(%]¥¹MÑ=¹Q½À ÀÌØíÍU$°ÅÕ½ÐìÅÕ½Ðì°Ä¤(%]¥¹5½Ù ÅÕ½Ðí]¥¹ ÈÁÀÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíà°ÀÌØíä¤(í%ͭѽÁ!¥¡ÐôÄÀÈÐQ¡¸]¥¹5½Ù ÀÌØíÍU$°ÅÕ½ÐìÅÕ½Ðì°Í­Ñ½Á!¥¡Ð¼ÄÜÀ°Í­Ñ½Á]¥Ñ ¼È¬ÌÈÀ¤)¹Õ¹()Õ¹Q½¼ ¤(%ÀÌØíÍIôÅÕ½Ðí¡±ÀÅÕ½ÐìQ¡¸5Í  ½à À°ÅÕ½Ðí!±ÀÅÕ½Ðì°ÅÕ½Ðíe½Ô¹¡±ÀüÅÕ½Ðì¤(%ÀÌØíÍIôÅÕ½Ðí±½°ÅÕ½ÐìQ¡¸5Í  ½à À°ÅÕ½Ðí1½°üÅÕ½Ðì°ÅÕ½Ðí]¡äÉå½Ô±Õ¡¥¹ÅÕ½Ðì¤)¹Õ¹
A decision is a powerful thing
Link to comment
Share on other sites

Hmm.. That doesn't work for the Win Bar App.

C:\Documents and Settings\James\My Documents\AutoIT Stuff\BorderlessGUI.au3 (25) : ==> Subscript used with non-Array variable.: 
$x = $pos[0] + $pos[2] - 200 
$x = $pos^ ERROR

About BetaPad.. If you post on the Topic, Razer should help you.. I don't know why its that big minus numbers.

Link to comment
Share on other sites

#include <GuiConstants.au3>
#NoTrayIcon

$sGUI = GuiCreate("WinBar App", 100, 20, -1, -1, BitOR($WS_POPUP, $WS_EX_TOPMOST),$WS_EX_TOOLWINDOW)
$sInput = GUICtrlCreateInput("", -1, -1, 102, 22)
GUICtrlSetLimit($sInput, 20)

GuiSetState()
WinSetOnTop($sGUI, "", 1)

While 1
    _WinMoveFix()
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $sInput
            $sRead = GuiCtrlRead($sInput)
            ToDo()
    EndSwitch
Wend

Func ToDo()
    If $sRead = "help" Then MsgBox(0, "Help", "You need help?")
    If $sRead = "notepad" Then Run("notepad.exe")
EndFunc

Func _WinMoveFix()
    $pos = WinGetPos($sGUI)
    $x = $pos[0] + $pos[2] - 200
    $y = $pos[1] + 5
    $w = $pos[2]
    $h = $pos[3]
    WinSetOnTop($sGUI, "", 1)
    WinMove($sGUI, "", $x, $y)
EndFunc

Now it just dissapears!

Link to comment
Share on other sites

$pos = WinGetPos($sGUI)

WinMove($sGUI)

This means you're asking for the cors and dimensions of $sGUI and then Moving it to that place, which is confusing. WinGetPos needs the name of a window that already exists. WinMove is going to move $sGUI to whatever array positions you give it, which are defined by WinGetPos.

Short answer :whistle:

$pos = WinGetPos("use a different window here like BetaPad") <------

WinMove($sGUI)

A decision is a powerful thing
Link to comment
Share on other sites

Shevilie, I'm confused. My bad, but what are you referring to? I just got lost in this thread for some reason. I read the thread you posted, but I don't understand what you were saying. Sorry. Any clarification is much appreciated. You're probably trying to say something important, but I'm just lost. Get me back on track captin :whistle:

A decision is a powerful thing
Link to comment
Share on other sites

You really should quit bouncing around ... starting new threads ... and answering questions (not so correctly I might add) when you have questions of your own that you have others doing the work for you on! That's a total lack of respect for those that have given you a hand (more like gave you the code).

And yep its important

Just have a look throug h the different topics here and you would understand http://www.autoitscript.com/forum/index.php?showuser=18298

Edited by Shevilie

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...