Sign in to follow this  
Followers 0
sandin

event on holding the title bar of GUI

3 posts in this topic

#1 ·  Posted (edited)

I have this script:

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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $GUI_EVENT_PRIMARYDOWN
            WinSetTrans($Form1,"",100)
            do
                dllcall("user32.dll","int","SendMessage","hWnd", $Form1,"int",0xA1,"int", 2,"int", 0)
                Local $msgg2 = GUIGetMsg()
            Until $msgg2 <> -7
            WinSetTrans($Form1,"",255)
    EndSwitch
WEnd

when u hold down mouse button anywhere in the GUI, gui turns transparent, and back to solid once u release mouse button.

Can someone help me do the same but with GUI's title bar? So when user move the GUI by holding the GUI's title bar, it becomes transparent.

Edited by sandin

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

here you go

edit : used sendmessage instead of dllcall

#include <SendMessage.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global Const $WM_ENTERSIZEMOVE = 0x0231 

$Trans = GUICreate("Click me to be transperent", 633, 447, 193, 125)
GUISetState()
GUIRegisterMsg($WM_ENTERSIZEMOVE,"WM_ENTERSIZEMOVE")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $GUI_EVENT_PRIMARYDOWN
            WinSetTrans($Trans,"",100)
            _SendMessage($Trans,$WM_NCLBUTTONDOWN, 2, 0)
            Do
                Sleep(10)
            Until GUIGetMsg() = $GUI_EVENT_PRIMARYUP
            WinSetTrans($Trans,"",255)
    EndSwitch
WEnd

Func WM_ENTERSIZEMOVE($hWndGUI, $MsgID, $WParam, $LParam)
    WinSetTrans($Trans,"",100)
EndFunc
Edited by komalo

[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

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  
Followers 0