Jump to content
Sign in to follow this  
laffo16

Example "About Page" but with GUISetState() problem, have code

Recommended Posts

laffo16

hey guys, im having a problem with GUISetState i believe. i know there are only so many possibilities with this function but im sure ive tried them all in a manor of different orders, maybe i have missed something. ive been working on my "About" page for my GUI for a day or two (got lost in several different forums along the way), scouting around the autoit forums picking up little bits of code here and their which i some how managed to mangle together. i did this how ever seperatly from my main program so that it would be easier in testing. testing done, looks good, now to impliment into my main program, and its here im stuck.

example 1: "example - without Main.au3"

this is the code which works, without a main gui and just loading straight into the about page.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <WinAPI.au3>
#include <Bad-Day.au3>

$voice_obj = ObjCreate("SAPI.SPVoice")

$GUI_About = GUICreate("About", 290, 182, 232, 161, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUIRegisterMsg($WM_MOVE, "WM_MOVE")
$GUI_About_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader1.gif", 8, 9, 123, 157, BitOR($SS_NOTIFY,$WS_GROUP))
$GUI_About_Top = GUICtrlCreateLabel("", 136, 0, 144, 32)
$GUI_About_Bottom = GUICtrlCreateLabel("", 136, 132, 144, 50)
GUICtrlSetState($GUI_About_Bottom, $GUI_DISABLE)
$GUI_About_Button = GUICtrlCreateButton("&Return", 204, 144, 75, 25, $BS_DEFPUSHBUTTON)
$GUI_About_Text_sample = "GREYHOUND TRADER" & @CRLF & @CRLF & "Created by Dean Lafferty" & @CRLF & "Email: Laffo16@hotmail.com" & @CRLF & "AKA: Laffo16" & @CRLF & @CRLF & "Big SHOUT out to all the AutoIt && Gruss forum users. Big Thanks to Gary && Mark Russell for keeping their software upto date and for really listening to their customer base, despite being overwhelmed by requests! ^^ and for making this program possible." & @CRLF & @CRLF & "Feel free to hit me with some feedback on the forum." & @CRLF & @CRLF & "Best of luck to you all!" & @CRLF & @CRLF & "PS. i wouldn't annoy the lazy dog, you have been warned!"
$GUI_About_Text = GUICtrlCreateLabel($GUI_About_Text_sample, 136, 180, 144, 330, BitOR($SS_CENTER,$WS_GROUP,$WS_CLIPSIBLINGS))

$GUI_About_Child = GUICreate("Child", 123, 157, 9, 10, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), -1, $GUI_About)
$GUI_About_Child_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader3.gif", 0, 0, 123, 157, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

WM_MOVE($GUI_About)

GUISetState(@SW_SHOW, $GUI_About_Child)
GUISetState(@SW_SHOW, $GUI_About)

GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE")

$GUI_About_Text_scroll_i = 180
$GUI_About_Pic_blink = 1
$GUI_About_Pic_blink_i = 1
$GUI_About_Child_fade = 1
$GUI_About_Child_fade_i = 300

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $nMsg1 = GUIGetCursorInfo()
            ;ToolTip($nMsg1[0] & " - " & $nMsg1[1] & " - " & $nMsg1[2] & " - " & $nMsg1[3] & " - " & $nMsg1[4], 0, 0)
            _SendMessage($GUI_About, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)
            If $nMsg1[4] = $GUI_About_Pic Then
                If IsObj($voice_obj) = 1 Then
                    $voice_obj.Speak($badday[Random(1,$badday[0],1)])
                EndIf
            EndIf
        Case $GUI_About_Button
            Exit
            
    EndSwitch
    
    $GUI_About_Text_scroll_i += -1
    ControlMove($GUI_About, "", $GUI_About_Text, 136, $GUI_About_Text_scroll_i)
    If $GUI_About_Text_scroll_i + 310 < 0 Then
        $GUI_About_Text_scroll_i = 170
        ControlMove($GUI_About, "", $GUI_About_Text, 136, $GUI_About_Text_scroll_i)
    EndIf
    
    Sleep(20)
    
    If Random(1, 50, 1) = 50 And $GUI_About_Pic_blink = 1 Then
        GUICtrlSetImage($GUI_About_Pic, @ScriptDir & "\GreyhoundTrader2.gif")
        $GUI_About_Pic_blink = 2
        $GUI_About_Pic_blink_i = 1
    EndIf
    
    If $GUI_About_Pic_blink = 2 Then
        $GUI_About_Pic_blink_i += 1
        If $GUI_About_Pic_blink_i >= 5 Then
            GUICtrlSetImage($GUI_About_Pic, @ScriptDir & "\GreyhoundTrader1.gif")
            $GUI_About_Pic_blink = 1
        EndIf
    EndIf
    
    If $GUI_About_Child_fade = 1 Then
        $GUI_About_Child_fade_i += -1
        If $GUI_About_Child_fade_i <= 255 And $GUI_About_Child_fade_i >= 0 Then
            WinSetTrans($GUI_About_Child, "", $GUI_About_Child_fade_i)
        EndIf
    EndIf
    
WEnd

Func WM_MOVE($hWndGUI)
    If $hWndGUI <> $GUI_About Then Return $GUI_RUNDEFMSG
    Local $ParentPosArr = WinGetPos($hWndGUI)
    WinMove($GUI_About_Child, "", $ParentPosArr[0]+9, $ParentPosArr[1]+10)
EndFunc

Func WM_ACTIVATE($hWndGUI)
    If $hWndGUI = $GUI_About_Child Then
        WinActivate($GUI_About)
    EndIf
EndFuncoÝ÷ ÙìZ^Ú«¨µ«mzjmÂ+a1¨§jíêºaz·¢©jX­¶WP"¶¢ë[ºÛhbr'qç%ÉvØ^ZvËazf¢e¶¸ êìjwZ[ayö§s+^Æ×Úv)à²Û}«"uè­¢(ºÜ!jܲz-çy×è®Øb²×¬¶Ø^¦ºé¢²ØZ¶'Ø·MúBn­jwtß¡ èºÐ¡Wm¢Zu«mëëb欶²v"¶azaz·±jjey«­¢+Ø¥¹±Õ±Ðí    ÕÑѽ¹
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±ÐíU%
½¹ÍѹÑÍà¹ÔÌÐì(¥¹±Õ±ÐíMÑÑ¥
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí5¹Õ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹A$¹ÔÌÐì(¥¹±Õ±Ðí µä¹ÔÌÐì((ÀÌØíÙ½¥}½¨ô=©
ÉÑ ÅÕ½ÐíMA$¹MAY½¥ÅÕ½Ðì¤((ÀÌØíU%}5¥¸ôU%
ÉÑ ÅÕ½Ðí5¥¸ÅÕ½Ðì°ÈÀÀ°ÈÀÀ°´Ä°´Ä°´Ä°´Ä¤(ÀÌØíU%}5¥¹}  ÕÑѽ¸ôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐìµÀí½ÕÐÅÕ½Ðì°ÈÀ°ÈÀ°ÜÔ°ÈÔ°ÀÌØí   M}AUM!  UQQ=8¤)U%MÑMÑÑ¡M]}M!=¤((ÀÌØíU%}½ÕÐôU%
ÉÑ ÅÕ½Ðí½ÕÐÅÕ½Ðì°ÈäÀ°ÄàÈ°ÈÌÈ°ÄØÄ°   ¥Ñ=H ÀÌØí]M}5%9%5%i   =`°ÀÌØí]M}MeM59T°ÀÌØí]M}A=AU@°ÀÌØí]M}A=AUA]%9=°ÀÌØí]M}I=U@°ÀÌØí]M} =IH°ÀÌØí]M}
1%AM%   1%9L¤¤)U%I¥ÍÑÉ5Í ÀÌØí]5}5=Y°ÅÕ½Ðí]5}5=YÅÕ½Ðì¤(ÀÌØíU%}½ÕÑ}A¥ôU%
Ñɱ
ÉÑA¥¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíÉ塽չQÉÈĹ¥ÅÕ½Ðì°à°ä°ÄÈÌ°ÄÔÜ°   ¥Ñ=H ÀÌØíMM}9=Q%d°ÀÌØí]M}I=U@¤¤(ÀÌØíU%}½ÕÑ}Q½ÀôU%
Ñɱ
ÉÑ1° ÅÕ½ÐìÅÕ½Ðì°ÄÌØ°À°ÄÐаÌȤ(ÀÌØíU%}½ÕÑ} ½Ñѽ´ôU%
Ñɱ
ÉÑ1° ÅÕ½ÐìÅÕ½Ðì°ÄÌØ°ÄÌÈ°ÄÐаÔÀ¤)U%
ÑɱMÑMÑÑ ÀÌØíU%}½ÕÑ}   ½Ñѽ´°ÀÌØíU%}%M   1¤(ÀÌØíU%}½ÕÑ}  ÕÑѽ¸ôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐìµÀíIÑÕɸÅÕ½Ðì°ÈÀаÄÐаÜÔ°ÈÔ°ÀÌØí    M}AUM!  UQQ=8¤(ÀÌØíU%}½ÕÑ}QáÑ}͵Á±ôÅÕ½ÐíIe!=U9QIHÅÕ½ÐìµÀì
I1µÀì
I1µÀìÅÕ½Ðí
ÉÑä¸1ÉÑäÅÕ½ÐìµÀì
I1µÀìÅÕ½Ðíµ¥°è1¼ÄÙ¡½Ñµ¥°¹½´ÅÕ½ÐìµÀì
I1µÀìÅÕ½Ðí-è1¼ÄØÅÕ½ÐìµÀì
I1µÀì
I1µÀìÅÕ½Ðí  ¥M!=UP½ÕÐѼ±°Ñ¡Õѽ%еÀìµÀìÉÕÍ̽ÉÕ´ÕÍÉ̸    ¥Q¡¹­ÌѼÉäµÀìµÀì5ɬIÕÍͱ°½È­Á¥¹Ñ¡¥ÈͽÑÝÉÕÁѼѹ½Èɱ±ä±¥Íѹ¥¹Ñ¼Ñ¡¥ÈÕÍѽµÈÍ°ÍÁ¥Ñ¥¹½ÙÉÝ¡±µäÉÅÕÍÑÌÌÌìyx¹½Èµ­¥¹Ñ¡¥ÌÁɽɴÁ½ÍÍ¥±¸ÅÕ½ÐìµÀì
I1µÀì
I1µÀìÅÕ½Ðí°ÉѼ¡¥ÐµÝ¥Ñ ͽµ¬½¸Ñ¡½ÉÕ´¸ÅÕ½ÐìµÀì
I1µÀì
I1µÀìÅÕ½Ðí  Íн±Õ¬Ñ¼å½Ô±°ÌÌìÅÕ½ÐìµÀì
I1µÀì
I1µÀìÅÕ½ÐíAL¸¤Ý½Õ±¸Ìäíй¹½äÑ¡±éä½°å½Ô¡Ù¸ÝɹÌÌìÅÕ½Ðì(ÀÌØíU%}½ÕÑ}QáÐôU%
Ñɱ
ÉÑ1° ÀÌØíU%}½ÕÑ}QáÑ}͵Á±°ÄÌØ°ÄàÀ°ÄÐаÌÌÀ°  ¥Ñ=H ÀÌØíMM}
9QH°ÀÌØí]M}I=U@°ÀÌØí]M}
1%AM%   1%9L¤¤)U%MÑMÑÑ¡M]}!%¤)U%MÑMÑÑ¡M]}%M  1¤)U%MÑMÑÑ¡M]}1=
,¤((ÀÌØíU%}½ÕÑ}
¡¥±ôU%
ÉÑ ÅÕ½Ðí
¡¥±ÅÕ½Ðì°ÄÈÌ°ÄÔÜ°ä°ÄÀ°    ¥Ñ=H ÀÌØí]M}A=AU@°ÀÌØí]M}
1%AM%   1%9L¤°´Ä°ÀÌØíU%}½ÕФ(ÀÌØíU%}½ÕÑ}
¡¥±}A¥ôU%
Ñɱ
ÉÑA¥¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíÉ塽չQÉÈ̹¥ÅÕ½Ðì°À°À°ÄÈÌ°ÄÔÜ°   ¥Ñ=H ÀÌØíMM}9=Q%d°ÀÌØí]M}I=U@°ÀÌØí]M}
1%AM%   1%9L¤¤)U%MÑMÑÑ¡M]}!%¤)U%MÑMÑÑ¡M]}%M  1¤)U%MÑMÑÑ¡M]}1=
,¤()]5}5=Y ÀÌØíU%}½ÕФ((íU%MÑMÑÑ¡M]}M!=°ÀÌØíU%}½ÕÑ}
¡¥±¤(íU%MÑMÑÑ¡M]}M!=°ÀÌØíU%}½ÕФ()U%I¥ÍÑÉ5Í ÀÌØí]5}
Q%YQ°ÅÕ½Ðí]5}
Q%YQÅÕ½Ðì¤((ÀÌØíU%}½ÕÑ}QáÑ}Íɽ±±}¤ôÄàÀ(ÀÌØíU%}½ÕÑ}A¥}±¥¹¬ôÄ(ÀÌØíU%}½ÕÑ}A¥}±¥¹­}¤ôÄ(ÀÌØíU%}½ÕÑ}
¡¥±}ôÄ(ÀÌØíU%}½ÕÑ}
¡¥±}}¤ôÌÀÀ()]¡¥±Ä($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($%
ÍÀÌØíU%}Y9Q}
1=M($$%á¥Ð($%
ÍÀÌØíU%}Y9Q}AI%5Ie=]8($$$ÀÌØí¹5ÍÄôU%Ñ
ÕÉͽÉ%¹¼ ¤($$$íQ½½±Q¥À ÀÌØí¹5ÍÅlÁtµÀìÅÕ½Ðì´ÅÕ½ÐìµÀìÀÌØí¹5ÍÅlÅtµÀìÅÕ½Ðì´ÅÕ½ÐìµÀìÀÌØí¹5ÍÅlÉtµÀìÅÕ½Ðì´ÅÕ½ÐìµÀìÀÌØí¹5ÍÅlÍtµÀìÅÕ½Ðì´ÅÕ½ÐìµÀìÀÌØí¹5ÍÅlÑt°À°À¤($$%%%ÍÉÉä ÀÌØí¹5ÍĤôÄQ¡¸($$$%}M¹5ÍÍ ÀÌØíU%}½ÕаÀÌØí]5}MeM
=559°  ¥Ñ=H ÀÌØíM
}5=Y°ÀÌØí!Q
AQ%=8¤°À¤($$$%%ÀÌØí¹5ÍÅlÑtôÀÌØíU%}½ÕÑ}A¥Q¡¸($$$$%%%Í=¨ ÀÌØíÙ½¥}½¨¤ôÄQ¡¸($$$$$$ÀÌØíÙ½¥}½¨¹MÁ¬ ÀÌØíåmI¹½´ Ä°ÀÌØíålÁt°Ä¥t¤($$$$%¹%($$$%¹%($$%¹%($%
ÍÀÌØíU%}½ÕÑ}    ÕÑѽ¸($$%U%MÑMÑÑ¡M]}9  1°ÀÌØíU%}5¥¸¤($$%U%MÑMÑÑ¡M]}!%°ÀÌØíU%}½ÕÑ}
¡¥±¤($$%U%MÑMÑÑ¡M]}!%°ÀÌØíU%}½ÕФ($%
ÍÀÌØíU%}5¥¹} ÕÑѽ¸($$%U%MÑMÑÑ¡M]}%M 1°ÀÌØíU%}5¥¸¤($$%U%MÑMÑÑ¡M]}9   1°ÀÌØíU%}½ÕÑ}
¡¥±¤($$%U%MÑMÑÑ¡M]}9    1°ÀÌØíU%}½ÕФ($$%U%MÑMÑÑ¡M]}M!=°ÀÌØíU%}½ÕÑ}
¡¥±¤($$%U%MÑMÑÑ¡M]}M!=°ÀÌØíU%}½ÕФ($$%U%MÑMÑÑ¡M]}U91=
,¤($$$(%¹MÝ¥Ñ ($(%M±À ÈÀ¤($)]¹()Õ¹]5}5=Y ÀÌØí¡]¹U$¤(%ÀÌØí¡]¹U$±ÐìÐìÀÌØíU%}½ÕÐQ¡¸IÑÕɸÀÌØíU%}IU95M(1½°ÀÌØíAɹÑA½ÍÉÈô]¥¹ÑA½Ì ÀÌØí¡]¹U$¤(]¥¹5½Ù ÀÌØíU%}½ÕÑ}
¡¥±°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíAɹÑA½ÍÉÉlÁt¬ä°ÀÌØíAɹÑA½ÍÉÉlÅt¬ÄÀ¤)¹Õ¹()Õ¹]5}
Q%YQ ÀÌØí¡]¹U$¤(%ÀÌØí¡]¹U$ôÀÌØíU%}½ÕÑ}
¡¥±Q¡¸($%]¥¹Ñ¥ÙÑ ÀÌØíU%}½ÕФ(%¹%)¹Õ¹

ok, a quick thanks to

rasim, for the dragable GUI example. http://www.autoitscript.com/forum/index.php?showtopic=85620

Ealric, for the jokes. http://www.autoitscript.com/forum/index.php?showtopic=71081

MrCreatoR, for the picture fading examples. http://www.autoitscript.com/forum/index.php?showtopic=55469

Melba23, for help with scrolling text http://www.autoitscript.com/forum/index.php?showtopic=93991

also idea of the scrolling text, using controlmove instead of guictrlsetpos, voice sam obj on and on....!! ^_^

source code & images attached, any help appreciated! a long post for a little question i guess, but i spent a while on this "About GUI" so i hope you guys like!

laffo16_source.zip

Share this post


Link to post
Share on other sites
laffo16

sry to bump, but on page 4 already lol ^^

Share this post


Link to post
Share on other sites
laffo16

ok guys, think im getting somewere...

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <WinAPI.au3>
#include <Bad-Day.au3>

$voice_obj = ObjCreate("SAPI.SPVoice")

$GUI_Main = GUICreate("Main", 200, 200, -1, -1, -1, -1)
$GUI_Main_Button = GUICtrlCreateButton("&About", 20, 20, 75, 25, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)

$GUI_About = GUICreate("About", 290, 182, 232, 161, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUIRegisterMsg($WM_MOVE, "WM_MOVE")
$GUI_About_Pic_Buffer = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader3.gif", 8, 9, 123, 157, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$GUI_About_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader1.gif", 8, 9, 123, 157, BitOR($SS_NOTIFY,$WS_GROUP))
$GUI_About_Top = GUICtrlCreateLabel("", 136, 0, 144, 32)
$GUI_About_Bottom = GUICtrlCreateLabel("", 136, 132, 144, 50)
GUICtrlSetState($GUI_About_Bottom, $GUI_DISABLE)
$GUI_About_Button = GUICtrlCreateButton("&Return", 204, 144, 75, 25, $BS_DEFPUSHBUTTON)
$GUI_About_Text_sample = "GREYHOUND TRADER" & @CRLF & @CRLF & "Created by Dean Lafferty" & @CRLF & "Email: Laffo16@hotmail.com" & @CRLF & "AKA: Laffo16" & @CRLF & @CRLF & "Big SHOUT out to all the AutoIt && Gruss forum users. Big Thanks to Gary && Mark Russell for keeping their software upto date and for really listening to their customer base, despite being overwhelmed by requests! ^^ and for making this program possible." & @CRLF & @CRLF & "Feel free to hit me with some feedback on the forum." & @CRLF & @CRLF & "Best of luck to you all!" & @CRLF & @CRLF & "PS. i wouldn't annoy the lazy dog, you have been warned!"
$GUI_About_Text = GUICtrlCreateLabel($GUI_About_Text_sample, 136, 180, 144, 330, BitOR($SS_CENTER,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_HIDE)

$GUI_About_Child = GUICreate("Child", 123, 157, 9, 10, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), -1, $GUI_About)
$GUI_About_Child_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader3.gif", 0, 0, 123, 157, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_HIDE)

WM_MOVE($GUI_About)

GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE")

$GUI_About_Text_scroll_i = 180
$GUI_About_Pic_blink = 1
$GUI_About_Pic_blink_i = 1
$GUI_About_Child_fade = 1
$GUI_About_Child_fade_i = 300

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $nMsg1 = GUIGetCursorInfo()
            ;ToolTip($nMsg1[0] & " - " & $nMsg1[1] & " - " & $nMsg1[2] & " - " & $nMsg1[3] & " - " & $nMsg1[4], 0, 0)
            $GUIcursorpos = GUIGetCursorInfo($GUI_About)
            If IsArray($GUIcursorpos) = 1 Then
                If $GUIcursorpos[0] >= 0 And $GUIcursorpos[0] <= 290 And $GUIcursorpos[1] >= 0 And $GUIcursorpos[1] <= 182 Then
                    _SendMessage($GUI_About, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)
                EndIf
            EndIf
        Case $GUI_About_Button
            GUISetState(@SW_ENABLE, $GUI_Main)
            
            GUISetState(@SW_DISABLE, $GUI_About)
            GUISetState(@SW_DISABLE, $GUI_About_Child)
            
            GUISetState(@SW_HIDE, $GUI_About)
            GUISetState(@SW_HIDE, $GUI_About_Child)
            
            GUICtrlSetState($GUI_About_Pic_Buffer, $GUI_SHOW)
            
            GUISetState(@SW_ENABLE, $GUI_About)
            GUISetState(@SW_ENABLE, $GUI_About_Child)
            
        Case $GUI_Main_Button
            GUISetState(@SW_LOCK)
            
            GUISetState(@SW_DISABLE, $GUI_Main)
            GUISetState(@SW_DISABLE, $GUI_About)
            GUISetState(@SW_DISABLE, $GUI_About_Child)
            
            GUICtrlSetState($GUI_About_Pic, $GUI_HIDE)
            
            GUISetState(@SW_SHOW, $GUI_About)
            GUISetState(@SW_SHOW, $GUI_About_Child)
            
            GUICtrlSetState($GUI_About_Pic, $GUI_SHOW)
            GUICtrlSetState($GUI_About_Pic_Buffer, $GUI_HIDE)
            
            GUISetState(@SW_ENABLE, $GUI_About)
            GUISetState(@SW_ENABLE, $GUI_About_Child)
            
            GUISetState(@SW_UNLOCK)
    EndSwitch
    
    Sleep(20)
    
WEnd

Func WM_MOVE($hWndGUI)
    ;ToolTip($hWndGUI & " <> " & $GUI_About, 0, 0)
    If $hWndGUI <> $GUI_About Then Return $GUI_RUNDEFMSG
    Local $ParentPosArr = WinGetPos($hWndGUI)
    WinMove($GUI_About_Child, "", $ParentPosArr[0]+9, $ParentPosArr[1]+10)
EndFunc

Func WM_ACTIVATE($hWndGUI)
    If $hWndGUI = $GUI_About_Child Then
        WinActivate($GUI_About)
    EndIf
EndFunc

with some heavy GUISetState calls and a buffer on $GUI_About_Child_Pic placing a duplicate copy at $GUI_About_Pic_Buffer the pics are now showing accordingly. only problem i have now is GUISetState(@SW_UNLOCK) seems to cause my desktop to flicker.

Edited by laffo16

Share this post


Link to post
Share on other sites
Valuater

I thinks I got it!!

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#include <WinAPI.au3>
;#include <Bad-Day.au3>

Global Const $WM_LBUTTONDOWN = 0x0201

$voice_obj = ObjCreate("SAPI.SPVoice")

$GUI_Main = GUICreate("Main", 200, 200, -1, -1, -1, -1)
$GUI_Main_Button = GUICtrlCreateButton("&About", 20, 20, 75, 25, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)

$GUI_About = GUICreate("About", 290, 182, 232, 161, BitOR($WS_POPUP, $WS_BORDER));$WS_MINIMIZEBOX, $WS_SYSMENU,$WS_GROUP, ,$WS_CLIPSIBLINGS $WS_POPUPWINDOW,
$GUI_About_Pic_Buffer = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader3.gif", 8, 9, 123, 157, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$GUI_About_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader1.gif", 8, 9, 123, 157, BitOR($SS_NOTIFY, $WS_GROUP))
$GUI_About_Top = GUICtrlCreateLabel("", 136, 0, 144, 32)
$GUI_About_Bottom = GUICtrlCreateLabel("", 136, 132, 144, 50)
GUICtrlSetState($GUI_About_Bottom, $GUI_DISABLE)
$GUI_About_Button = GUICtrlCreateButton("&Return", 204, 144, 75, 25, $BS_DEFPUSHBUTTON)
$GUI_About_Text_sample = "GREYHOUND TRADER" & @CRLF & @CRLF & "Created by Dean Lafferty" & @CRLF & "Email: Laffo16@hotmail.com" & @CRLF & "AKA: Laffo16" & @CRLF & @CRLF & "Big SHOUT out to all the AutoIt && Gruss forum users. Big Thanks to Gary && Mark Russell for keeping their software upto date and for really listening to their customer base, despite being overwhelmed by requests! ^^ and for making this program possible." & @CRLF & @CRLF & "Feel free to hit me with some feedback on the forum." & @CRLF & @CRLF & "Best of luck to you all!" & @CRLF & @CRLF & "PS. i wouldn't annoy the lazy dog, you have been warned!"
$GUI_About_Text = GUICtrlCreateLabel($GUI_About_Text_sample, 136, 180, 144, 330, BitOR($SS_CENTER, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_HIDE)

$GUI_About_Child = GUICreate("Child", 123, 157, 9, 10, BitOR($WS_POPUP, $WS_CLIPSIBLINGS), -1, $GUI_About)
$GUI_About_Child_Pic = GUICtrlCreatePic(@ScriptDir & "\GreyhoundTrader3.gif", 0, 0, 123, 157, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_HIDE)

;WM_MOVE($GUI_About)
;GUIRegisterMsg($WM_MOVE, "WM_MOVE")
;GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE")
GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")


$GUI_About_Text_scroll_i = 180
$GUI_About_Pic_blink = 1
$GUI_About_Pic_blink_i = 1
$GUI_About_Child_fade = 1
$GUI_About_Child_fade_i = 300

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $nMsg1 = GUIGetCursorInfo()
            ;ToolTip($nMsg1[0] & " - " & $nMsg1[1] & " - " & $nMsg1[2] & " - " & $nMsg1[3] & " - " & $nMsg1[4], 0, 0)
            ;_SendMessage($GUI_About, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0)
            If IsArray($nMsg1) = 1 Then
                If $nMsg1[4] = $GUI_About_Pic Then
                    If IsObj($voice_obj) = 1 Then
                        ; $voice_obj.Speak($badday[Random(1,$badday[0],1)])
                    EndIf
                EndIf
            EndIf
        Case $GUI_About_Button
            GUISetState(@SW_ENABLE, $GUI_Main)

            GUISetState(@SW_DISABLE, $GUI_About)
            GUISetState(@SW_DISABLE, $GUI_About_Child)

            GUISetState(@SW_HIDE, $GUI_About)
            GUISetState(@SW_HIDE, $GUI_About_Child)

            GUICtrlSetState($GUI_About_Pic_Buffer, $GUI_SHOW)

            GUISetState(@SW_ENABLE, $GUI_About)
            GUISetState(@SW_ENABLE, $GUI_About_Child)

        Case $GUI_Main_Button
            GUISetState(@SW_LOCK)

            GUISetState(@SW_DISABLE, $GUI_Main)
            GUISetState(@SW_DISABLE, $GUI_About)
            GUISetState(@SW_DISABLE, $GUI_About_Child)

            GUICtrlSetState($GUI_About_Pic, $GUI_HIDE)

            GUISetState(@SW_SHOW, $GUI_About)
            GUISetState(@SW_SHOW, $GUI_About_Child)

            GUICtrlSetState($GUI_About_Pic, $GUI_SHOW)
            GUICtrlSetState($GUI_About_Pic_Buffer, $GUI_HIDE)

            GUISetState(@SW_ENABLE, $GUI_About)
            GUISetState(@SW_ENABLE, $GUI_About_Child)

            GUISetState(@SW_UNLOCK)
    EndSwitch

    Sleep(20)

WEnd

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If $HWnd <> $GUI_About Then Return $GUI_RUNDEFMSG
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc   ;==>_WinMove

Func WM_MOVE($hWndGUI)
    ;ToolTip($hWndGUI & " <> " & $GUI_About, 0, 0)
    If $hWndGUI <> $GUI_About Then Return $GUI_RUNDEFMSG
    Local $ParentPosArr = WinGetPos($hWndGUI)
    WinMove($GUI_About_Child, "", $ParentPosArr[0] + 9, $ParentPosArr[1] + 10)
EndFunc   ;==>WM_MOVE

Func WM_ACTIVATE($hWndGUI)
    If $hWndGUI = $GUI_About_Child Then
        WinActivate($GUI_About)
    EndIf
EndFunc   ;==>WM_ACTIVATE

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
laffo16

thanks for your help Valuater, still a bit of a flicker problem.

Edited by laffo16

Share this post


Link to post
Share on other sites
Valuater

thanks for your help Valuater

Welcome, I helped with movement, However this is "Over-Kill"

GUISetState(@SW_ENABLE, $GUI_Main)

            ;GUISetState(@SW_DISABLE, $GUI_About)
            ;GUISetState(@SW_DISABLE, $GUI_About_Child)

            GUISetState(@SW_HIDE, $GUI_About)
            GUISetState(@SW_HIDE, $GUI_About_Child)

            ;GUICtrlSetState($GUI_About_Pic_Buffer, $GUI_SHOW)

            ;GUISetState(@SW_ENABLE, $GUI_About)
            ;GUISetState(@SW_ENABLE, $GUI_About_Child)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
GEOSoft

If you search Example Scripts there are a couple of examples of pre-built "About" dialogs. I did one and other people have done their own versions. I also have one someplace that uses an embedded IE object so that I could use colors, images and auto-scrolling text using JS.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.