James Posted December 25, 2007 Share Posted December 25, 2007 Hey all, I am trying to make a window stick to another window. Example, I open the run box and another program sticks directly on to it, so if I move he window on top the run box moves with it. I thought SetParent would do this, but it didn't. Thanks, James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 (edited) I haven't a solution... but,Maybe you could get some ideas from this...http://www.autoitscript.com/forum/index.ph...gnetic&st=0Edit: 100 posts! Watch out SmOke_N! Edited December 25, 2007 by The Ape FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
star2 Posted December 25, 2007 Share Posted December 25, 2007 #include <guiconstants.au3> GUICreate ("Test" , 150 , 80) $exit = GUICtrlCreateButton ("Exit" , 20 , 30 ,100,25) GUISetState () While 1 $a = WinGetPos ("Untitled - Notepad","") WinMove ("Test" ,"" , $a[0],$a[1],150,80,3) $msg = GUIGetMsg () Select Case $msg = $exit Exit EndSelect WEnd I don't know if this can help [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 #include <guiconstants.au3> GUICreate ("Test" , 150 , 80) $exit = GUICtrlCreateButton ("Exit" , 20 , 30 ,100,25) GUISetState () While 1 $a = WinGetPos ("Untitled - Notepad","") WinMove ("Test" ,"" , $a[0],$a[1],150,80,3) $msg = GUIGetMsg () Select Case $msg = $exit Exit EndSelect WEndoÝ÷ Øhmz0ûaÇ¥§ú®¢×zY]¢wj¸¶*'m«vßÊ«{¦¦WºÚ"µÍÚ[ÛYH ÙÝZXÛÛÝ[Ë]LÉÝÂÌÍÙÝZLHHÕRPÜX]H ][ÝÙÝZLI][ÝÈMLLKLJBÌÍÙ^]HÕRPÝÜX]P]Û ][ÝÑ^] ][ÝÈÌLJBÕRTÙ]Ý]H BÌÍØHHÚ[Ù]ÜÈ ÌÍÙÝZLJBÌÍÙÝZLHÕRPÜX]H ][ÝÙÝZL][ÝÈML ÌÍØVÌKLML ÌÍØVÌWJBÕRTÙ]Ý]H BÚ[HBIÌÍØHHÚ[Ù]ÜÈ ÌÍÙÝZLJBUÚ[[ÝH ÌÍÙÝZL ][ÝÉ][ÝÈ ÌÍØVÌKLML ÌÍØVÌWKMLJBIÌÍÛÙÈHÕRQÙ]ÙÈ BÙ[XÝØÙH ÌÍÛÙÈH ÌÍÙ^]^]BPØÙH ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑHBBQ^]Q[Ù[XÝÑ[ FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
James Posted December 25, 2007 Author Share Posted December 25, 2007 Unfortunatley it can't "stick" or "clip" in realtime. I tried it this way aswell Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 Unfortunatley it can't "stick" or "clip" in realtime. I tried it this way aswell Ya', I'm trying. I'm sure you'll have to use things I'm not willing to try (GUIRegisterMsg - _SendMessage). Good luck! FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
BrettF Posted December 25, 2007 Share Posted December 25, 2007 How does this go?? #include <GuiconstantsEx.au3> Global Const $WM_EXIT_SIZE_MOVE = 0x0232 $gui1 = GUICreate ("gui1" , 150 , 80, -1, -1) $exit = GUICtrlCreateButton ("Exit" , 20 , 30 ,100,25) GUISetState () $a = WinGetPos ($gui1) $gui2 = GUICreate ("gui2" , 150 , 80, $a[0]-150, $a[1]) GUISetState () GUIRegisterMsg ($WM_EXIT_SIZE_MOVE, "Move") While 1 $msg = GUIGetMsg () Select Case $msg = $exit Exit Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Move ($hWnd, $Msg, $wParam, $lParam) If $hWnd <> $gui1 Then $get = WinGetPos ($gui2) $size = WinGetClientSize ($gui2) $size2 = WinGetClientSize ($gui1) WinMove ($gui1, "", $get[0]+$size[0], $get[1]) Else $get = WinGetPos ($gui1) $size = WinGetClientSize ($gui1) $size2 = WinGetClientSize ($gui2) WinMove ($gui2, "", $get[0]-$size[0], $get[1]) EndIf EndFunc Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 How does this go?? #include <GuiconstantsEx.au3> Global Const $WM_EXIT_SIZE_MOVE = 0x0232 $gui1 = GUICreate ("gui1" , 150 , 80, -1, -1) $exit = GUICtrlCreateButton ("Exit" , 20 , 30 ,100,25) GUISetState () $a = WinGetPos ($gui1) $gui2 = GUICreate ("gui2" , 150 , 80, $a[0]-150, $a[1]) GUISetState () GUIRegisterMsg ($WM_EXIT_SIZE_MOVE, "Move") While 1 $msg = GUIGetMsg () Select Case $msg = $exit Exit Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Move ($hWnd, $Msg, $wParam, $lParam) If $hWnd <> $gui1 Then $get = WinGetPos ($gui2) $size = WinGetClientSize ($gui2) $size2 = WinGetClientSize ($gui1) WinMove ($gui1, "", $get[0]+$size[0], $get[1]) Else $get = WinGetPos ($gui1) $size = WinGetClientSize ($gui1) $size2 = WinGetClientSize ($gui2) WinMove ($gui2, "", $get[0]-$size[0], $get[1]) EndIf EndFuncI like how both windows eventually "stick" to one another... but, still not real-time. FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 How about... #include <GuiconstantsEx.au3> Global Const $WM_MOVE = 0x0003 $gui1 = GUICreate ("gui1" , 150 , 80, -1, -1) $exit = GUICtrlCreateButton ("Exit" , 20 , 30 ,100,25) GUISetState () $a = WinGetPos ($gui1) $gui2 = GUICreate ("gui2" , 150 , 80, $a[0]-150, $a[1]) GUISetState () GUIRegisterMsg ($WM_MOVE, "Move") While 1 $msg = GUIGetMsg () Select Case $msg = $exit Exit Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Move ($hWnd, $Msg, $wParam, $lParam) If $hWnd <> $gui1 Then $get = WinGetPos ($gui2) $size = WinGetClientSize ($gui2) $size2 = WinGetClientSize ($gui1) WinMove ($gui1, "", $get[0]+$size[0], $get[1]) Else $get = WinGetPos ($gui1) $size = WinGetClientSize ($gui1) $size2 = WinGetClientSize ($gui2) WinMove ($gui2, "", $get[0]-$size[0], $get[1]) EndIf EndFunc FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
star2 Posted December 25, 2007 Share Posted December 25, 2007 How about...ooo u made it before me I was making some tea while u posted u're nice jobnice job !!! [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] Link to comment Share on other sites More sharing options...
BrettF Posted December 25, 2007 Share Posted December 25, 2007 What a change! 1 line! Wowwwwwwwww! *Claps* Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 What a change! 1 line! Wowwwwwwwww! *Claps*Well done Bert! FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
James Posted December 26, 2007 Author Share Posted December 26, 2007 Perfect! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now