Jump to content
Sign in to follow this  
FeReNGi

how can i move this window

Recommended Posts

Can i move the windows from next function ?

SplashScreen("Install", "This Program")


Func SplashScreen($SplashText, $ProgramText)
    Local $Strlen = StringLen($ProgramText)
    Local $Font="Comic Sans MS"     
    GUICreate("SplashScreen", 550, 130, -1, 1, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST,$WS_EX_TOOLWINDOW,  $WS_EX_CLIENTEDGE ))
;   GUICtrlCreatePic(@TempDir & "\Header.JPG",10, 10, 0, 0, 0)
    GUICtrlCreateLabel($ProgramText, 500 - ($Strlen*10 ), 25, 120 + ($Strlen*10) , 30)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont (-1, 16, 400, 2, $Font)

    $GuiSplashText = GUICtrlCreateLabel($Splashtext, 20, 90, 510, -1)
    GUICtrlSetFont (-1, 12, 400, 4, $Font)

    GUISetState(@SW_SHOW)
EndFunc

Now i can't move the window

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>

Global $lbl_ptext
$gui = SplashScreen("Install", "This Program")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $lbl_ptext Or $msg = $GUI_EVENT_PRIMARYDOWN
            _Drag($gui)
    EndSelect
WEnd

Func SplashScreen($SplashText, $ProgramText)
    Local $Strlen = StringLen($ProgramText)
    Local $Font="Comic Sans MS"        
    Local $gui = GUICreate("SplashScreen", 550, 130, -1, 1, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST,$WS_EX_TOOLWINDOW,  $WS_EX_CLIENTEDGE ))
;    GUICtrlCreatePic(@TempDir & "\Header.JPG",10, 10, 0, 0, 0)
    $lbl_ptext = GUICtrlCreateLabel($ProgramText, 500 - ($Strlen*10 ), 25, 120 + ($Strlen*10) , 30)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont (-1, 16, 400, 2, $Font)

    $GuiSplashText = GUICtrlCreateLabel($Splashtext, 20, 90, 510, -1)
    GUICtrlSetFont (-1, 12, 400, 4, $Font)

    GUISetState(@SW_SHOW)
     Return $gui
EndFunc


Func _Drag ($h_gui)
    DllCall("user32.dll", "int", "ReleaseCapture")
    DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0)
EndFunc   ;==>_Drag

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

This doesn't work in the time i want to do something else.

The splashscreen should be there when other code is executed and also i like to move this window in the meantime.

Is this possibel ?

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $lbl_ptext Or $msg = $GUI_EVENT_PRIMARYDOWN
            _Drag($gui)

        Case Else

             code to  be executed


    EndSelect
WEnd
Edited by FeReNGi

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>

Global $lbl_ptext, $GuiSplashText
$gui = SplashScreen("Install", "This Program")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $lbl_ptext Or $msg = $GUI_EVENT_PRIMARYDOWN
            _Drag($gui)
            Case $msg = $GuiSplashText
                MsgBox(0,"Doing", "something else")
    EndSelect
WEnd

Func SplashScreen($SplashText, $ProgramText)
    Local $Strlen = StringLen($ProgramText)
    Local $Font="Comic Sans MS"        
    Local $gui = GUICreate("SplashScreen", 550, 130, -1, 1, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST,$WS_EX_TOOLWINDOW,  $WS_EX_CLIENTEDGE ))
;    GUICtrlCreatePic(@TempDir & "\Header.JPG",10, 10, 0, 0, 0)
    $lbl_ptext = GUICtrlCreateLabel($ProgramText, 500 - ($Strlen*10 ), 25, 120 + ($Strlen*10) , 30)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont (-1, 16, 400, 2, $Font)

    $GuiSplashText = GUICtrlCreateLabel($Splashtext, 20, 90, 510, -1)
    GUICtrlSetFont (-1, 12, 400, 4, $Font)

    GUISetState(@SW_SHOW)
     Return $gui
EndFunc


Func _Drag ($h_gui)
    DllCall("user32.dll", "int", "ReleaseCapture")
    DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0)
EndFunc   ;==>_Drag

carefull with using the case else


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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  

×
×
  • Create New...