Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 20:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[AutoIT] Window Mover Source

Discussion on [AutoIT] Window Mover Source within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
theoneofgod's Avatar
 
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
[AutoIT] Window Mover Source

Code:
    #NoTrayIcon
    #RequireAdmin
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    MsgBox(0, "Instructions", "Use the arrow keys on the keyboard to move the active window", 7)

    $vDLL= DllOpen("user32.dll")

    ; (Main) GUI
    $hGUI = GUICreate("Window Mover", 167, 62)
    GUISetBkColor(0)
    ;-

    ; (Main) Label
    GUICtrlCreateLabel("Movement pixels:", 18, 23, 86, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    ;-

    ; (Main) Input
    $hInput_Pixel = GUICtrlCreateInput("5", 108, 19, 43, 21, BitOR($ES_AUTOHSCROLL, $WS_BORDER), $WS_EX_STATICEDGE)
    GUICtrlSetLimit(-1, 6, 1)
    ;-

    GUISetState(@SW_SHOW, $hGUI)

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case -3
             Exit
       EndSwitch

       If _IsPressed("25", $vDLL) Then ; left
          $iPos = WinGetPos("[active]")
          WinMove("[active]", "", $iPos[0] - GUICtrlRead($hInput_Pixel), $iPos[1])
       EndIf

       If _IsPressed("26", $vDLL) Then ; up
          $iPos = WinGetPos("[active]")
          WinMove("[active]", "", $iPos[0], $iPos[1] - GUICtrlRead($hInput_Pixel))
       EndIf

       If _IsPressed("27", $vDLL) Then ; right
          $iPos = WinGetPos("[active]")
          WinMove("[active]", "", $iPos[0] + GUICtrlRead($hInput_Pixel), $iPos[1])
       EndIf

       If _IsPressed("28", $vDLL) Then ; down
          $iPos = WinGetPos("[active]")
          WinMove("[active]", "", $iPos[0], $iPos[1] + GUICtrlRead($hInput_Pixel))
       EndIf

       Sleep(10)
    WEnd

    Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
       ; $hexKey must be the value of one of the keys.
       ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
       Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
       If @error Then Return SetError(@error, @extended, False)
       Return BitAND($a_R[0], 0x8000) <> 0
    EndFunc   ;==>_IsPressed
theoneofgod is offline  
Old 10/23/2011, 07:14   #2
 
elite*gold: 0
Join Date: Oct 2011
Posts: 1
Received Thanks: 0
good

good,!!!!!!!!!!!!!!!!
good!!!!!!!!!!!!!!!
zhangjm9 is offline  
Reply


Similar Threads Similar Threads
[RELEASE] [OPEN SOURCE] CE 5.5 Pointer to AutoIt Source-Code
02/13/2011 - AutoIt - 6 Replies
Habe heute erst gemerkt, dass es hier eine AutoIt Sektion gibt xD also poste ich mal mein Programm mit rein. Funktionsweise: 1. in CE Rechtsklick auf den Pointer und auf "Copy" klicken 2. in meinem Programm auf "Code generieren" klicken 3. In euer Scite gehen und einfügen Hier ist der Source Code vom Programm:
Autoit work on only one window
08/08/2010 - PW Hacks, Bots, Cheats, Exploits - 4 Replies
Hello, anyone knows how I could make a script that runs in a single window defined? For example I want it to work on perfect world, and I want to make MSN the same time .. Thx
AutoIt Window Info
03/09/2010 - Nostale - 4 Replies
Kann mir wer sagen wie ich das Programm, bzw den Programmteil AutoIt Window Info auch im Vordergrund offen haben kann wenn ich Nostale im Vollbildmodus aufhabe ? hab vor mir nen Bot zu schreiben, allerdings ist das nicht so leicht wenn man die Pixelsearch Daten nicht rausgekriegt. Danke für Antworten ;)



All times are GMT +1. The time now is 20:28.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.