Jump to content

gui run while moveing


Alek
 Share

Recommended Posts

i needed this for a script, i found something like this but it was a bit overcomplicated for me :rolleyes:

#include <guiconstants.au3>
#include <Misc.au3>

Global $label[99][99]
$oldxpos = 0
$oldypos = 0

$gui = GUICreate("",98,98,-1,-1,$WS_POPUP,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
GUISetBkColor(0x000000)
AdlibEnable("changecolor",70)

for $x = 1 to 3
    for $y = 1 to 3
        $label[$x][$y] = GUICtrlCreateLabel(" ",($x*32)-30,($y*32)-30,30,30,$SS_SUNKEN+$SS_CENTER)
        GUICtrlSetBkColor(-1,"0x" & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2))
    Next
Next

$msg = GUIGetMsg()
GUISetState()

While $msg <> -3
    $msg = GUIGetMsg()
    
    ;to get the cursor position inside the gui
    $minfo = GUIGetCursorInfo($gui) 
    
     ;to see if the the left mouse button is down
    if _IsPressed("01") Then
        
        ;while your left mouse button is down
        while _IsPressed("01")
            
            ;to the cursor position in the desktop
            $mpos = MouseGetPos() 
            if $mpos[0] <> $oldxpos or $mpos[1] <> $oldypos then
                ;moves the gui to the right position acording to the gui, if your useing a normal gui then
                ;you need to add a bit of offset
                ;Winemove($gui,"",$mpos[0]-$minfo[0]+/-xoffset,$mpos[1]-$minfo[1]+/- yoffset)
                WinMove($gui,"",$mpos[0]-$minfo[0],$mpos[1]-$minfo[1]) 
            EndIf
            sleep(5)
        WEnd
    EndIf
WEnd

Func changecolor()
    GUICtrlSetBkColor($label[Random(1,4,0)][Random(1,4,0)],"0x" & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2))
    GUICtrlSetBkColor($label[Random(1,4,0)][Random(1,4,0)],"0x" & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2))
EndFunc
Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

i pushed it to the limit :rolleyes:

#include <guiconstants.au3>
#include <Misc.au3>

Global $X[ÎNNWVÎNNWBÌÍÛÛÜÈHÌÍÛÛÜÈHÌÍÙÝZHHÕRPÜX]J    V÷C²gV÷C²ÄFW6·F÷vGF³"ÄFW6·F÷VvB³"ÃÃÂb33cµu5õõUÂb33cµu5ôUQ==1]%9=¬ÀÌØí]M}a}Q=A5=MP¤)U%MÑ ­
½±½È ÁàÀÀÀÀÀÀ¤(()½ÈÀÌØíàôÄÑ @DesktopWidth/32
    for $y = 1 to @DesktopHeight/32
        $la[ÉÌÍÞVÉÌÍÞWHHÕRPÝÜX]SX[
    ][ÝÈ  ][ÝË
    ÌÍÞ
ÌKLÌ
    3c·£3"Ó3Ã3Ã3Âb33cµ55õ5Tä´Tâ²b33cµ55ô4TåDU"¢uT7G&Å6WD&´6öÆÈ ´Ä°ÅÕ½ÐìÁàÅÕ½ÐìµÀì!à¡I¹½´ À°ÈÔ԰Ĥ°È¤µÀì!à¡I¹½´ À°ÈÔ԰Ĥ°) & Hex(Random(0,255,1),2))
    Next
Next

$msg = GUIGetMsg()
GUIS]Ý]J
BYX[XJ  ][ÝØÚ[ÙXÛÛÜ][ÝËJBÚ[H  ÌÍÛÙÈ  ÉÝÈL¢b33c¶×6rÒuTvWD×6r¢¢·FòvWBFR7W'6÷"÷6Föâç6FRFÕ¤(ÀÌØíµ¥¹¼ôU%Ñ
ÕÉͽÉ%¹¼ ÀÌØíÕ¤¤((íѼͥѡ the left mouse button is down
    if _IsPressed("01") Then
     ÝÚ[H[ÝY[ÝÙH]ÛÈÝÛÚ[HÒÔÜÙY
    V÷C³gV÷C²¢¢·FòFR7W'6÷"÷6FöââFRFW6·½À(ÀÌØíµÁ½Ìô5½ÕÍÑA½Ì ¤(¥ÀÌØíµÁ½ÍlÁt±Ð> $oldxpos or $mpos[1] <> $oldypos then
           Û[ÝÈHÝZHÈHYÚÜÚ][ÛXÛÜ[ÈÈHÝZKY[ÝÙZ[ræ÷&ÖÂwVFVࢷ÷RæVVBFòFB&Böböfg6W@¢í]¥¹µ½Ù ÀÌØíÕ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíµÁ½ÍlÁt´ÀÌØíµ¥¹½lÁt¬¼µá½fset,$mpos[1]-$minfo[1]+/- yoffset)
                WinMove(&#036ÙÝZK ][ÝÉ][ÝË    ÌÍÛÜÖÌKIÌÍÛZ[ÖÌK ÌÍÛÜÖÌWKIÌÍÛZ[ÖÌWJ¢VæD`¢6ÆVWR¢tVæ@¢VæD`¥tVæ@ ¤gVæ2¡¹½±½È ¤(%½ÈÀÌØíàôÄѼÈÀ($%U%
ÑɱMÑ   ­
½±½È ÀÌØí±±mI¹½´ ,(@DesktopWidth/32)+1,0)][Random(1,(@DesktopHeight/32)+1,0)],"0x" [È^
[ÛJMKJKH   [È^
[ÛJMKJKH   [È^
[ÛJÃ#SRÃÃ" æW@¤VæDgVæ0

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

Hi Alek,

Lol that's a great finding but... regarding the subject of your post, I don't like it.

The GUI moves every time you press the left mouse button and then move your mouse (drag action). And that's wrong, because there's the situation when you're moving another window, and there it goes your GUI! Bye!!!!

Nevertheless, I think it would be solved if it checked for WinActive() first.

Lol randomize the square sizes and you got yourself a cool screensaver!!!! but not a CPU saver :rolleyes:

Link to comment
Share on other sites

Hi Alek,

Lol that's a great finding but... regarding the subject of your post, I don't like it.

The GUI moves every time you press the left mouse button and then move your mouse (drag action). And that's wrong, because there's the situation when you're moving another window, and there it goes your GUI! Bye!!!!

Nevertheless, I think it would be solved if it checked for WinActive() first.

oh, didn't notis :rolleyes:, a easy fix for it

just change out the while loop with this

While $msg <> -3
    $msg = GUIGetMsg()
    
    ;to get tHÝÛÜÜÚ][Û[ÚYHHÝZB  ÌÍÛZ[ÈHÕRQÙ]ÝÛÜ[Ê ÌÍÙV¢¢·Fò6VRbFRFRÆVgBÖ÷W6R'WGFöâ2F÷và¢bô5&W76 ÅÕ½ÐìÀÄÅÕ½Ðì¤Q¡¸((íÝ¡¥±å½Õȱе½ÕÍÕÑѽ¸¥Ì½n
        while _IsPressed("01")
            
            ;to theÝÛÜÜÚ][Û[HÚÝÜ   ÌÍÛÜÈH[ÝÙQÙ]ÜÊ
Hbb33c¶×÷5³ÒfÇC²fwC²b33c¶öÆG÷2÷"b33c¶×÷5³ÒfÇC²fwC²bÀÌØí½±åÁ½Ì¹]¥¹Ñ¥Ù ÀÌØíÕ¤¤Ñ¡¸íÝ¥¹Ñ¥ÙѼͥ¥ÑÌå½ÕÈÕ¤that you are trying to move, i you add  "and $minfo[1] < 20 th[][ÝÈ[ÝHÚ[ÛHHXHÈYÈY[Ý[ÝÙHÈ]HÜÙHÝöæÇ¢¶Ö÷fW2FRwVFòFR&vB÷6Föâ6÷&FærFòFRÕ¤°¥å½ÕÈÕÍ¥¹¹½Éµ°Õ¤Ñ¡¸(íå½Ô¹Ñ¼¥ of offset
                ;Winemove($gui,"",$mpos[0]-&ÌÍÛZ[ÖÌJËË^ÙÙ] ÌÍÛÜÖÌWKIÌÍÛZ[ÖÌWJËËH[ÙÙ]
BväÖ÷fRb33c¶wVÂgV÷C²gV÷C²Âb33c¶×÷5³ÒÒb33c¶Öæfõ³ÒÂb33c¶×÷5Åt´ÀÌØíµ¥¹½lÅt¤(¹%(ͱÀ Ô¤(]¹(EndIf
WEnd

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

oh, didn't notis :rolleyes:, a easy fix for it

just change out the while loop with this

are you going to try and make the squars go bifg and smaller...

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

also add this at the top :

HotKeySet("{esc}", "exitr") ; close windowoÝ÷ Ù§]¶­ë-ºw^®«y«­¢+Ø¥¹±Õ±Ðí5¥Í¹ÔÌÐìoÝ÷ ÚÊ"¶Z(ÉbëaÆ®¶­sb6æ6ÇVFRfÇC´Ö62æS2fwC° ¤÷D¶W6WBgV÷C·¶W67ÒgV÷C²ÂgV÷C¶WG"gV÷C²±½ÍÝ¥¹½ÜoÝ÷ ÚØ^§]¶¬jëh×6Func exitr()  ;tells window to close
    exit
EndFunc 
oÝ÷ ÚéÝz¸^­æ®¶­sdgVæ26ævV6öÆ÷"¢f÷"b33c·ÒFò#¢uT7G&Å6WD&´6öÆ÷"b38í±±mI¹½´ Ä°¡Í­Ñ½Á]¥Ñ ¼ÌȤ¬Ä°À¥umI¹½´ Ä°¡Í­Ñ½Á!¥¡Ð¼ÌȤ¬Ä°À¥|"0x" & Hex(Random(0,255,1),2) & Hex(Random(0,255,1),2) &kÈ^
[ÛJMKJKJBBB^BBB[[oÝ÷ ÚÚ&jG¢¶Z(X¤zØb±«­¢+ÙÕ¹¡¹½±½È ¤(½ÈÀÌØíàôÄѼÈÀ(U%
ÑɱMÑ   ­
½±½È ÀÎ;label[Random(1,(@DesktopWidth/32)+1,0)][Random(1,(@DesktopHeight/32)+1,0)_    ][ÝÌ  ][ÝÈ  [È^
[ÛJMKJKH   [È^
[ÛJMKJKH   ײW&æFöÒÃ#SRÃÃ" ¢æW@  ¤VæDgVæ0 ¤gVæ2WG"·FVÆÇ2¥¹½ÜѼ±½Í(%á¥Ð)¹Õ¹

the is you press 'ESC' the window will exit

lol i love it... just i like to edit stuff

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

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...