x_files_x Posted May 7, 2013 Share Posted May 7, 2013 (edited) Mrb arkadaşlar ben bu örneği deneme olarak yaptım bişi için, ancak bunu nasıl istedigim zaman taşıma özelligi koyucam, pencere sabit hareket etmiyor birde scripti açınca alttaki görev cubugunda olmasın istiyorum, yardım edebilecek varmı acaba? #include <GUIConstants.au3> #include <WindowsConstants.au3> GUICreate('Defuse', 75, 67, 1200, 200, $WS_POPUP, $WS_EX_TOPMOST) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUISetState() While 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $gob Exit EndSwitch WEnd WEnd Edited May 7, 2013 by x_files_x Quote Link to comment Share on other sites More sharing options...
reyiz Posted May 7, 2013 Share Posted May 7, 2013 #include <GUIConstants.au3> #include <WindowsConstants.au3> #NoTrayIcon GUICreate('Defuse', 75, 67, 1200, 200, "", $WS_EX_TOPMOST) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUISetState() While 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $gob Exit EndSwitch WEnd WEnd Quote Link to comment Share on other sites More sharing options...
Mehmet Posted May 7, 2013 Share Posted May 7, 2013 (edited) Senin sorunun cevabı burada http://www.tnctr.com/topic/201260-tathynabilir-pencere-nasyl-yapylyr/ veya #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate('Defuse', 75, 67, 1200, 200, _ BitOR($WS_SIZEBOX, $WS_POPUP), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUIRegisterMsg(0x0201, "moveGUI") GUISetState(@SW_SHOW) GUISetBkColor(0x3CC2BD) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $gob Exit EndSwitch WEnd Func MoveGUI($hW) DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $Form1, "uint", 0x0112, "wparam", 0xF012, "lparam", 0) EndFunc Edited May 7, 2013 by MeHMeTBeN Quote Link to comment Share on other sites More sharing options...
x_files_x Posted May 7, 2013 Author Share Posted May 7, 2013 ama taşınmadı hala? ilk verdiginiz örnekte sadece pencere boyutu büyüdü, digerinde ise, benim guinin kenarlıkları yoktu bunun var, olmadı Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 7, 2013 Share Posted May 7, 2013 (edited) #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate('Defuse', 75, 67, 1200, 200, _ BitOR($WS_SIZEBOX, $WS_POPUP), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUIRegisterMsg(0x0201, "MoveGUI") GUISetState(@SW_SHOW) GUISetBkColor(0x3CC2BD) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $gob Exit EndSwitch WEnd Func MoveGUI() DllCall('user32.dll', 'int', 'SendMessage', 'hWnd', $Form1, 'int', 0x00A1, 'int', 2, 'int', 0) EndFunc ;==>MoveGUI VEYA #include <GUIConstants.au3> #include <WindowsConstants.au3> $GUI = GUICreate('Defuse', 75, 67, 1200, 200, $WS_POPUP, $WS_EX_TOPMOST) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $gob Exit EndSwitch WEnd Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) If ($hWnd = $GUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION EndFunc ;==>WM_NCHITTEST Yeni farkettim MostWanted ın dediği gibi ucundan sürekleyerek oluyor maalesef. Edited May 7, 2013 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
MostWanted Posted May 7, 2013 Share Posted May 7, 2013 Taşınabiliyor. Diğeri sadece kenarlık ekledi falan deme onları kaldırabilirsin.Hiç GuiCreate'in attiributelarına bakmıyor musun? #include <GUIConstants.au3> #include <WindowsConstants.au3> $hGUI=GUICreate('Defuse', 105, 67, 1200, 200,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUIRegisterMsg(0x0201, "moveGUI") GUISetState(@SW_SHOW) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $gob Exit EndSwitch WEnd Func MoveGUI($hW) DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hGUI, "uint", 0x0112, "wparam", 0xF012, "lparam", 0) EndFunc Burdaki tek sorun şu ki sadece objeye tutularak taşınamıyor.Yani Gui'de sadece buton objesi olunca sağa sola sürükleyemiyorsun onu azıcık ucundan boşluk olmalı ki ordan sürükleyebilesin.Sorununu çözebilecek bir örnek vardı hatırlıyorum fakat araştırmam gerekli. Quote Link to comment Share on other sites More sharing options...
reyiz Posted May 7, 2013 Share Posted May 7, 2013 Normalde pencereler hiç bir attribute eklemeden taşınabiliyor. Sizin amacınız MostWanted gibi pencerenin içinden tıklayarak taşıttırmak mı? Quote Link to comment Share on other sites More sharing options...
Mehmet Posted May 7, 2013 Share Posted May 7, 2013 (edited) #NoTrayIcon #include <ButtonConstants.au3> #include <WindowsConstants.au3> Global $form1 = GUICreate("Defuse", 75, 67, 1200, 200, -2146959360, $WS_EX_TOOLWINDOW) $gob = GUICtrlCreateButton('Kapat', 2, 2, 70, 62) GUIRegisterMsg(0x0201, "mehmetben_WinMove1") WinSetTrans($form1, "", 170) WinSetOnTop($form1, "", 1) GUISetState(@SW_SHOW) GUISetBkColor (0xffffff) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $gob, -3 Exit EndSwitch WEnd Func mehmetben_WinMove1($hwnd) If BitAND(WinGetState($hwnd), 32) Then Return "GUI_RUNDEFMSG" DllCall("user32.dll", "long", "SendMessage", "hwnd", $hwnd, "int", 0x0112, "int", 0xF009, "int", 0) EndFunc istediğin bu sanırım :) Edited May 7, 2013 by MeHMeTBeN Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 7, 2013 Share Posted May 7, 2013 Üstte yazılanlarla aynı işi yapıyor mehmetben yani bi farkı yok arkadaşın isteği direk butonun taşınması ucundan tutulup taşınması değil yani bu fonksiyonu da hatırlıyorum sanki genelde bluelife "GUI_RUNDEFMSG" kullanır da :D Quote Link to comment Share on other sites More sharing options...
MostWanted Posted May 7, 2013 Share Posted May 7, 2013 (edited) @reyiz dediğin doğru çünkü default değerler buna izin veriyor ama arkadaşın guisi özel bir gui onda taşınamıyor. @mehmetben zaten o kodlar yukarda verilmiş. Edit:Simpson zaten söylemiş neyse. Edited May 7, 2013 by MostWanted Quote Link to comment Share on other sites More sharing options...
Mehmet Posted May 7, 2013 Share Posted May 7, 2013 Üstte yazılanlarla aynı işi yapıyor mehmetben yani bi farkı yok arkadaşın isteği direk butonun taşınması ucundan tutulup taşınması değil yani bu fonksiyonu da hatırlıyorum sanki genelde bluelife "GUI_RUNDEFMSG" kullanır da :D bence objeyi tutarak taşıyamaz formdaki objeler çalışmaz ozaman yani eğer öyle bir fonksiyon katılırsa :( Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 7, 2013 Share Posted May 7, 2013 Ben buton değil de progress için yapıldığını hatırlıyorum ama bulamadım onu maalesef. Quote Link to comment Share on other sites More sharing options...
Mehmet Posted May 7, 2013 Share Posted May 7, 2013 Taşınıyormuş :facepalm: #include <GuiconstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "On_Exit") $hGUI = GUICreate("X", 100, 100, -1, -1, $WS_POPUP) GUISetBkColor(0xFF0000, $hGUI) $hLabel = GUICtrlCreateLabel("", 0, 0, 100, 50, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetBkColor(-1, 0x00FF00) ;GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Test", 10, 35, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $hButton On_Button() EndSwitch WEnd Func On_Button() MsgBox(0, "Hi", "Button Pressed") EndFunc ;==>On_Button Func On_Exit() Exit EndFunc ;==>On_Exit Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 7, 2013 Share Posted May 7, 2013 _WinAPI_SetLayeredWindowAttributes ile de arkasını şeffaf yaptınmıydı tadından yenmez :D Quote Link to comment Share on other sites More sharing options...
x_files_x Posted May 7, 2013 Author Share Posted May 7, 2013 Hepinize cevaplarınız için tşk ederim, kuusra bakmayın ben acemi oldugum icin bilmedigim cok sey var, tıpkı guicreat in o yanındakilerin ne anlama geldikleri gibi, bilseydim zaten ben ordan yapardım, yardımlarınız icin tşk ederim, sanırım buton tutularak taşınmıyormus, bunuda öğrenmiş oldum Quote Link to comment Share on other sites More sharing options...
x_files_x Posted May 7, 2013 Author Share Posted May 7, 2013 #include <GuiconstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "On_Exit") $hGUI = GUICreate("X", 100, 100, -1, -1, $WS_POPUP) GUISetBkColor(2368804, $hGUI) $hLabel = GUICtrlCreateLabel("", 0, 0, 100, 20, -1, $GUI_WS_EX_PARENTDRAG) ;~ GUICtrlSetBkColor(-1, 0x00) ;GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Test", 2, 2, 95, 95) GUISetState() While 1 Switch GUIGetMsg() Case $hButton On_Button() EndSwitch WEnd Func On_Button() Exit EndFunc ;==>On_Button Func On_Exit() Exit EndFunc ;==>On_Exit böyle bişi yaptım üstten taşınıyor Quote Link to comment Share on other sites More sharing options...
x_files_x Posted May 8, 2013 Author Share Posted May 8, 2013 Arkadaslar buldum, eğer lazım olur die düsünüyorsanız buyrun, hepinize çok tşk ederim, #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $SC_DRAGMOVE = 0xF012 HotKeySet('{ESC}', '_Exit') Example() Func Example() Local $hGUI = GUICreate('', 100, 100, Default, Default, $WS_POPUP) _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF) Local $iButton = GUICtrlCreateButton('Drag me', 0, 0, 100, 100) GUISetState(@SW_SHOW, $hGUI) Local $aCtrlCursor = 0, $aMousePos = 0, _ $fMove = False, _ $iBefore = 0 While 1 Switch GUIGetMsg() Case $iButton MsgBox($MB_SYSTEMMODAL, '', 'Button click') ; ExitLoop Case $GUI_EVENT_PRIMARYDOWN $aCtrlCursor = GUIGetCursorInfo($hGUI) $aMousePos = MouseGetPos() $fMove = False $iBefore = $aMousePos[0] + $aCtrlCursor[0] + $aMousePos[1] + $aCtrlCursor[1] ; Detect the co-ordinates before. While _IsPressed(01) WinMove($hGUI, '', $aMousePos[0] - $aCtrlCursor[0], $aMousePos[1] - $aCtrlCursor[1]) ; _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, False) ; If the co-ordinates are different then it moved. $fMove = Not ($aMousePos[0] + $aCtrlCursor[0] + $aMousePos[1] + $aCtrlCursor[1] = $iBefore) $aMousePos = MouseGetPos() If @error Then ExitLoop WEnd ; If it moved clear the button message. If $fMove Then Do ; Clear the button message. Until GUIGetMsg() = 0 EndIf EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _Exit() Exit EndFunc ;==>_Exit Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted August 17, 2014 Share Posted August 17, 2014 Arkadaslar buldum, eğer lazım olur die düsünüyorsanız buyrun, hepinize çok tşk ederim, #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $SC_DRAGMOVE = 0xF012 HotKeySet('{ESC}', '_Exit') Example() Func Example() Local $hGUI = GUICreate('', 100, 100, Default, Default, $WS_POPUP) _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF) Local $iButton = GUICtrlCreateButton('Drag me', 0, 0, 100, 100) GUISetState(@SW_SHOW, $hGUI) Local $aCtrlCursor = 0, $aMousePos = 0, _ $fMove = False, _ $iBefore = 0 While 1 Switch GUIGetMsg() Case $iButton MsgBox($MB_SYSTEMMODAL, '', 'Button click') ; ExitLoop Case $GUI_EVENT_PRIMARYDOWN $aCtrlCursor = GUIGetCursorInfo($hGUI) $aMousePos = MouseGetPos() $fMove = False $iBefore = $aMousePos[0] + $aCtrlCursor[0] + $aMousePos[1] + $aCtrlCursor[1] ; Detect the co-ordinates before. While _IsPressed(01) WinMove($hGUI, '', $aMousePos[0] - $aCtrlCursor[0], $aMousePos[1] - $aCtrlCursor[1]) ; _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, False) ; If the co-ordinates are different then it moved. $fMove = Not ($aMousePos[0] + $aCtrlCursor[0] + $aMousePos[1] + $aCtrlCursor[1] = $iBefore) $aMousePos = MouseGetPos() If @error Then ExitLoop WEnd ; If it moved clear the button message. If $fMove Then Do ; Clear the button message. Until GUIGetMsg() = 0 EndIf EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _Exit() Exit EndFunc ;==>_Exit gerçekten kullanışlı, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.