Jump to content

How to move popup form by picture


Reddragon
 Share

Go to solution Solved by nend,

Recommended Posts

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
Link to comment
Share on other sites

  • Solution

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
Link to comment
Share on other sites

 

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

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