Jex Posted November 21, 2007 Share Posted November 21, 2007 (edited) I'm trying learn DllCall function but i can't manage to use that simple function : http://msdn2.microsoft.com/en-us/library/ms632678.aspxWhich type i need use for "BOOL" ?$hwnd = "AutoIt" $Test = DllCall("user32.dll", "", "CloseWindow", "hwnd", $hwnd) MsgBox("", "", $Test)oÝ÷ Ù8Z¶z-Âäغ¹Again not work. Edited November 21, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
BrettF Posted November 21, 2007 Share Posted November 21, 2007 Windows Datatype = DllCall Type BOOL = "int" COLORREF = "int" DWORD = "int" HANDLE = "ptr" HDC = "ptr" HFILE = "int" HFONT = "ptr" HICON = "ptr" HINSTANCE = "ptr" HKEY = "ptr" HMENU = "ptr" HMODILE = "ptr" HWND = "hwnd" INT = "int" LONG = "long" LPARAM = "long" LPCTSTR = "str" ("wstr" if a UNICODE function) LPINT = "int_ptr" LPLONG = "long_ptr" UINT = "int" ULONG = "long" WPARAM = "int" $hwnd = GUICreate ("Tester") GUISetState () Sleep (1000) MsgBox (0, "", "GUI Should Close after this message") $Test = DllCall("user32.dll", "int", "CloseWindow", "hwnd", $hwnd) MsgBox("", "", $Test[0]) 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...
Jex Posted November 21, 2007 Author Share Posted November 21, 2007 Thanks Bert My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
rasim Posted November 21, 2007 Share Posted November 21, 2007 I'm trying learn DllCall function but i can't manage to use that simple function : http://msdn2.microsoft.com/en-us/library/ms632678.aspx Which type i need use for "BOOL" ? $hwnd = "AutoIt" $Test = DllCall("user32.dll", "", "CloseWindow", "hwnd", $hwnd) MsgBox("", "", $Test)ƒoÝŠ÷ Ù8Z¶z-Šäغ¹oÝ÷ Øyè· +ú®¢×ºÚ"µÍÌÍÚÓHÚ[Ù][J ][ÝÉÌL NÉÌL ÍÎÉÌL ÎNÉÌLNNÉÌL ÉÌLLÎÉÌL NÉÌL NÉÌLNNÉÌLNÉ][ÝÊBØ[ ][ÝÝÙÌ ][ÝË ][ÝÛÛI][ÝË ][ÝÐÛÜÙUÚ[ÝÉ][ÝË ][ÝÚÛ ][ÝË ÌÍÚÓ Link to comment Share on other sites More sharing options...
rasim Posted November 21, 2007 Share Posted November 21, 2007 (edited) Bert Thanks for Windows Datatype = DllCall Type Edited November 21, 2007 by rasim Link to comment Share on other sites More sharing options...
Jex Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) $hwnd = GUICreate ("Test") GUISetState() Sleep(1000) DllCall("user32.dll", "int", "MoveWindow", "hwnd", $hwnd, "int", "300", "int", "250", "int", "550", "int", "500", "int", "") Sleep(3000)Working But showing second window ?By the way reason is why my first post script not work, I'm not used "WinGetHandle". ( Thanks Rasim ) Edited November 21, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Jex Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) DragDetect Function The DragDetect function captures the mouse and tracks its movement until the user releases the left button, presses the ESC key, or moves the mouse outside the drag rectangle around the specified point. The width and height of the drag rectangle are specified by the SM_CXDRAG and SM_CYDRAG values returned by the GetSystemMetrics function. Syntax BOOL DragDetect( HWND hwnd, POINT pt ); Parameters hwnd [in] Handle to the window receiving mouse input. pt [in] Initial position of the mouse, in screen coordinates. The function determines the coordinates of the drag rectangle by using this point. Return Value If the user moved the mouse outside of the drag rectangle while holding down the left button, the return value is nonzero. If the user did not move the mouse outside of the drag rectangle while holding down the left button, the return value is zero. $Test = GUICreate("Test") GUISetState() Do $Pos = MouseGetPos() $Test = DllCall("user32.dll", "int", "DragDetect", "hwnd", $Test, "int", $Pos) Until $Test <> 0 What i need write for POINT and pt ? I think im writed completely wrong that script Edited November 21, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Siao Posted November 21, 2007 Share Posted November 21, 2007 What i need write for POINT and pt ?If you're already browsing MSDN, why not find your answer there? POINT structureDllCall("user32.dll", "int", "DragDetect", "hwnd", $Test, "long", $x, "long", $y) "be smart, drink your wine" Link to comment Share on other sites More sharing options...
star2 Posted January 7, 2008 Share Posted January 7, 2008 $hwnd = GUICreate ("Test") GUISetState() Sleep(1000) DllCall("user32.dll", "int", "MoveWindow", "hwnd", $hwnd, "int", "300", "int", "250", "int", "550", "int", "500", "int",True) Sleep(3000) is this OK for you? [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...
Jex Posted January 7, 2008 Author Share Posted January 7, 2008 $hwnd = GUICreate ("Test") GUISetState() Sleep(1000) DllCall("user32.dll", "int", "MoveWindow", "hwnd", $hwnd, "int", "300", "int", "250", "int", "550", "int", "500", "int",True) Sleep(3000) is this OK for you? I'm opened this topic 47 days ago but still thanks. My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
star2 Posted January 7, 2008 Share Posted January 7, 2008 I'm opened this topic 47 days ago but still thanks. well I'm havong a problem like yours and I was searching the forum for answers and I found your topic and searched for answers for it in the msdn and found that your missing parameter is only the [True] parameter, so I tried it and it worked now my problem is that I want to move the GUI using the Dll function just like using the WinMove() function in autoit until now I'm getting the [MoveWindow] in the user32.dll , it ok but without animating the window I want to slide the window with a sense of animation. anyway if you have any ideas please don't be shy. hope that your script is OK now. [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...
PsaltyDS Posted January 7, 2008 Share Posted January 7, 2008 The return is alway in an array: $PID = Run("notepad.exe") WinWait("Untitled - Notepad") $hWin = WinGetHandle("Untitled - Notepad") Sleep(2000) $Test = DllCall("user32.dll", "int", "MoveWindow", "hwnd", $hWin, "int", 200, "int", 200, "int", 200, "int", 200, "int", True) MsgBox(64, "Result", "$Test = " & $Test[0]) Sleep(2000) $Test = DllCall("user32.dll", "int", "MoveWindow", "hwnd", $hWin, "int", 400, "int", 400, "int", 400, "int", 400, "int", True) MsgBox(64, "Result", "$Test = " & $Test[0]) Sleep(2000) $Test = DllCall("user32.dll", "int", "CloseWindow", "hwnd", $hWin) MsgBox(64, "Result", "$Test = " & $Test[0]) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 17, 2008 Share Posted March 17, 2008 hy, DragDetect function is correctly ?Don't hijack this topic. New question = new topic. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
BrettF Posted March 19, 2008 Share Posted March 19, 2008 (edited) Technically you did hi-jack it. This topic was about the question from Jex. Not you. So take the advice. Create a new topic.Gah! Edited March 19, 2008 by Bert 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...
anib Posted March 19, 2008 Share Posted March 19, 2008 Ok, excuse me for this replique , i'm to create a new post for question thank a lot Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR 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