Jump to content
Sign in to follow this  
Reddragon

How to move popup form by picture

Recommended Posts

Reddragon

Well i have created a popup form and want to move the form by using a picture on the form.How do I do it?

I have written a code but its not working

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 146, $WS_POPUP, 0)
$Pic1 = GUICtrlCreatePic("", 40, 56, 337, 161, 0, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
nend

Do you mean this?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 146, $WS_POPUP, 0)
$Pic1 = GUICtrlCreatePic("", 40, 56, 337, 161, 0, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_NCHITTEST, "Dragwindow")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func Dragwindow($hWnd, $iMsg, $iwParam, $ilParam)
    If $iMsg = $WM_NCHITTEST Then
        Return $HTCAPTION
    EndIf
EndFunc
  • Like 1

Share this post


Link to post
Share on other sites
Reddragon

 

Do you mean this?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 146, $WS_POPUP, 0)
$Pic1 = GUICtrlCreatePic("", 40, 56, 337, 161, 0, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_NCHITTEST, "Dragwindow")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func Dragwindow($hWnd, $iMsg, $iwParam, $ilParam)
    If $iMsg = $WM_NCHITTEST Then
        Return $HTCAPTION
    EndIf
EndFunc

YEs.

Thanks mate

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  

×