Jump to content

[SOLVED]While issue


 Share

Recommended Posts

simple multi disc install, now trying to add visuals. How might I get the lines in the While to run throughout the entire process. In the snip provided I am unable to get GDI to draw along the bottom of the screen WHILE the tooltips are in action, move it above the actions and the tooltips never start, below it never draws.

#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Tooltip ("Copying Span 1", 0 , 0)
sleep (20000)

Msgbox (0, 'Disc 2...' , " Please Insert Disc 2")


Tooltip ("Copying Span 2", 0 , 0)
sleep (20000)



    While 1

    $Top = @desktopheight - 81
    $Bottom = @Desktopheight
    $MAX = 50
    $Blocks = $MAX
    $each  = @DesktopWidth / $Blocks

For $i = 1 to $Blocks
$Rcolor = random (0x000000 , 0xFFFFFF)
For $x = $each * ($i - 1) To $each * $i
For $y = $Top To $Bottom

    _PixelSetColor ($x , $y , $Rcolor)

Next
Next

If $i = $Blocks Then
$i = 0
$Top = @Desktopheight - 81
$Bottom = @Desktopheight
$Blocks = Random (3 , $MAX , 1)
$each  = @DesktopWidth / $Blocks
Endif
Next

Wend


Func _PixelSetColor($XCoord, $YCoord, $Color)
    Local $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    If Not IsArray($dc) Then Return -1
    DllCall("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $XCoord, "long", $YCoord, "long", _
            "0x" & StringRegExpReplace(hex($Color,6), "(..)(..)(..)", "\3\2\1")) ; Change to 0xBBGGRR hex colour format.
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "hwnd", $dc[0])
EndFunc ;==>_PixelSetColor
Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

ummm, i dont know about totally wrong...

if you copy my code from the while 1 down and run it you will see the drawing function as i want it to function. A running bar of color along the bottom of the screen that would run letting the user know something is still occuring, not necessarily where it is in the process. I will try making my own gui and drawing on that but I did not believe that of any consequence with GDI+.

My question would still persist. Can you perform any other actions whilst letting GDI draw pretty pictures.

SOLVED:

draw.exe being the while 1 portion, calling as a seperate executable seems to do the trick. Would still like to know how to solve that in a single script if possible. Thanks.

#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


run ("draw.exe")

Tooltip ("Copying Span 1", 0 , 0)
sleep (20000)

Msgbox (0, 'Disc 2...' , " Please Insert Disc 2")


Tooltip ("Copying Span 2", 0 , 0)
sleep (20000)
Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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