Jump to content

Recommended Posts

Posted

I've tried that and it doesn't work. I get errors for 99% of them... I have the LATEST installed and I did everything just as it said... but it just doesn't work... (I'm talking about Auto3Lib)

Well, then you must be doing something wrong. But, if you want to reinvent the wheel, be my guest. :)
Auto3Lib: A library of over 1200 functions for AutoIt
Posted

Hey, can I ask for help with one more issue? I want to user user32's GetWindowRect... any idea how? I've tried using the help file and searching the forums... this is what I've got, but it always returns 0, so I know it's wrong...

$win = WinGetHandle("")
$str        = "int;ubyte;uint;char"
$a          = DllStructCreate($str)
$dll = DllCall("user32.dll", DllStructGetPtr($a), "GetWindowRect", "hwnd", $win)
MsgBox(0, "", $int)
1.) What is $int ??

2.) Did you read the definition of GetWindowRect on MSDN? The parameters you are using do not match the definition on MSDN.

3.) Did you read the DLLCall explanation of PaulIA?

4.) Did you compare your code to the implementation of PaulIA? Do you see any difference?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted (edited)

1.) What is $int ??

2.) Did you read the definition of GetWindowRect on MSDN? The parameters you are using do not match the definition on MSDN.

3.) Did you read the DLLCall explanation of PaulIA?

4.) Did you compare your code to the implementation of PaulIA? Do you see any difference?

Hmmmm... Ok well this doesn't work either:

$tPoint  = DllStructCreate("int X; int Y; int W; int H")
$aResult = DllCall("User32.dll", "int", "GetWindowRect", "ptr", DllStructGetPtr($tPoint))
ConsoleWrite("Return result ...: " & $aResult[0] & @CR)
ConsoleWrite("Cursor X position: " & DllStructGetData($tPoint, "X") & @CR)
ConsoleWrite("Cursor Y position: " & DllStructGetData($tPoint, "Y") & @CR)
ConsoleWrite("Cursor width: " & DllStructGetData($tPoint, "W") & @CR)
ConsoleWrite("Cursor height: " & DllStructGetData($tPoint, "H") & @CR)

Where do I put the Hwnd?

Edited by magician13134
Posted

Hmmmm... Ok well this doesn't work either:

...

Where do I put the Hwnd?

well, as you refuse to check the code in AU3Lib, i did it for you !! Now, compare your code with the one below and you will see how to do it.

Global Const $tagRECT = "int Left;int Top;int Right;int Bottom"
Func _API_GetWindowRect($hWnd)
  Local $tRect

  $tRect = DllStructCreate($tagRECT)
  DllCall("User32.dll", "int", "GetWindowRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))
  Return $tRect
EndFunc

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted (edited)

Thank you for the code, but I've told you, Auto3Lib doesn't work for me.

Global Const $tagRECT = "int Left;int Top;int Right;int Bottom"

$hWnd = WinGetHandle("")
$tRect = DllStructCreate($tagRECT)
DllCall("User32.dll", "int", "GetWindowRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))

MsgBox(0, "", DllStructGetData($tRect, "Bottom"))

Ok, that worked, but that just is the same as WinGetPos() then I suppose, isn't it? It doesn't tell you what the position of the window is if it's being moved or resized... oh well. Thanks

Edited by magician13134
Posted

Thank you for the code, but I've told you, Auto3Lib doesn't work for me.

aha...

Ok, that worked,

Oh, it works. Strange ...

but that just is the same as WinGetPos() then I suppose, isn't it?

Yes it's the same.

It doesn't tell you what the position of the window is if it's being moved or resized... oh well. Thanks

did you read the help file section for WinGetPos()?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted

aha...

Oh, it works. Strange ...

Yes it's the same.

did you read the help file section for WinGetPos()?

I don't think you believe me that Auto3Lib doesn't work. I wish it were so, there are some great functions, but I always get errors when I use them. Also, the help section for WinGetPos() has nothing to do with this, firstly because I didn't know they were the same and secondly because I already know exactly what WinGetPos() does... Would you happen to know a function that would let me find out if a window was being resized/moved?

I can't use a WinGetPos() in a loop because the window doesn't move until I drop it, and I can use the MouseGetCursor() and _IsPressed(01) to find out if the window if being resized, but nothing helps me with moving....

Posted

I can't use a WinGetPos() in a loop because the window doesn't move until I drop it, and I can use the MouseGetCursor() and _IsPressed(01) to find out if the window if being resized, but nothing helps me with moving....

to be honest, I don't know what you are trying to do. WinGetPos() gives you the position and the size of a window, so I don't see why you can't use it. Maybe it's time to post your code, so we can see the problem and probably suggest a solution.

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted

I don't think you believe me that Auto3Lib doesn't work. I wish it were so, there are some great functions, but I always get errors when I use them. Also, the help section for WinGetPos() has nothing to do with this, firstly because I didn't know they were the same and secondly because I already know exactly what WinGetPos() does... Would you happen to know a function that would let me find out if a window was being resized/moved?

I can't use a WinGetPos() in a loop because the window doesn't move until I drop it, and I can use the MouseGetCursor() and _IsPressed(01) to find out if the window if being resized, but nothing helps me with moving....

<sigh>Magician, you have much to learn in life. I hope you survive the journey. :)

If you're getting Auto3Lib errors, you are more than likely guilty of one or more of the following:

1. Didn't read the "Read this before you download" in the Auto3Lib thread or Downloads section. (Definitely)

2. Didn't install the latest production version of AutoIt first. (Probably)

3. Didn't read the installer readme that came up during the Auto3Lib installation.

4. Didn't install Auto3Lib using the same path that AutoIt is installed with.

5. Didn't read the "Feedback" section of the Auto3Lib help file. (Definitely)

6. Didn't post a question in the Auto3Lib thread asking for help. (Definitely)

Please select your number:

@/dev/null: You have far more patience than I do to deal with people like this. God bless you!

Auto3Lib: A library of over 1200 functions for AutoIt
Posted

Ok, let me try to answer everything now.

/dev/null:

I am trying to figure out when a window is being moved or resized. When you move or resize it, there is a grey border until you release the mouse, I need to know when that's happening and what its coordinates are. Make sense?

I have the LATEST version installed. 3.2.4.9

It's installed in C:\Program Files\AutoIt3 which is where autoit is installed

I've already asked a question about Auto3Lib specifically, and I got very little help

I did read the topic and such, but my parent's won't let me get internet in my room, and won't let me install Autoit on this computer, because apparently if it's not Netscape or Norton, it's a virus.

If you want screenshots of my autoit directory, or specific error codes, I can give you those, but it'll take some time, I'll need to find a thumb-drive...

post-18326-1181619168_thumb.jpg

Posted

Ok, let me try to answer everything now.

/dev/null:

I am trying to figure out when a window is being moved or resized. When you move or resize it, there is a grey border until you release the mouse, I need to know when that's happening and what its coordinates are. Make sense?

I have the LATEST version installed. 3.2.4.9

It's installed in C:\Program Files\AutoIt3 which is where autoit is installed

I've already asked a question about Auto3Lib specifically, and I got very little help

I did read the topic and such, but my parent's won't let me get internet in my room, and won't let me install Autoit on this computer, because apparently if it's not Netscape or Norton, it's a virus.

If you want screenshots of my autoit directory, or specific error codes, I can give you those, but it'll take some time, I'll need to find a thumb-drive...

In a previous post in this very thread, you made the same type of "it don't work" statement when I posted 4 lines of AutoIt code. You're doing the same thing now. You've made a mistake somewhere in installing/using Auto3Lib and instead of asking for specific help, you're just throwing up your hands and crying "it don't work" again.

You'll find that most of the folks here (me included) are more than willing to help you out, but you've got to meet us half way. If you're having problems (with Auto3Lib or any other piece of code), post the code you're using and the errors that you're getting and we'll be more than happy to help you out.

Auto3Lib: A library of over 1200 functions for AutoIt
Posted (edited)

@/dev/null: You have far more patience than I do to deal with people like this. God bless you!

well, sometimes there is this undefinable urge to help people. I don't know where that comes from ;-)

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted

Ok, let me try to answer everything now.

/dev/null:

I am trying to figure out when a window is being moved or resized. When you move or resize it, there is a grey border until you release the mouse, I need to know when that's happening and what its coordinates are. Make sense?

Well, at least I think I know what you want to do. O.K. here we go:

You cannot detect a position or size change of a window you did not create with AutoIT (firefox in your screenshot), except if you

1.) reread the position and size in an "never ending" loop with WinGetPos() and compare the current values with the

previous ones. This is easy to do with AutoIT.

2.) install a system hook that intercepts all system messages and tries to filter the one for a specific window. This is virtually impossible to do with AutoIT.

Hope that helps....

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted (edited)

No, no, I can't do a loop and WinGetPos(), the position DOESN'T change until the mouse is dropped. I need to do actions in the time when the window is being resized. So there's no way to tell when a window has that grey border via Autoit?

Oh, and PaulIA, I reinstalled auto3lib and it works fine. I'm REALLY sorry about this. (I have some errors from before if you even care, but I doubt you do, since it's fixed...)

Anyway, this is what I got when I tried to run some of the examples from the help file...

#include <A3LAVI.au3>

Global $hGUI, $hAVI

; Create a GUI to play AVI clips on
$hGUI = GUICreate("AVI Test GUI", 300, 100)
$hAVI = _AVI_Create($hGUI, 10, 10)
GUISetState()

; Play the sample AutoIt AVI
_AVI_Open($hAVI, _Lib_AutoItDir() & "\Examples\GUI\SampleAVI.avi")

; Wait for user to close GUI
do
until GUIGetMsg() = $GUI_EVENT_CLOSE

; Close AVI clip
_AVI_Close($hAVI)

#cs
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\admin\Desktop\autoit\New AutoIt v3 Script.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams    
+>13:04:28 Starting AutoIt3Wrapper v.1.7.7
>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3
+>13:04:29 AU3Check ended.rc:0
>Running:(3.2.4.9):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\admin\Desktop\autoit\New AutoIt v3 Script.au3"    
C:\PROGRA~1\AutoIt3\Include\A3LStructs.au3 (296) : ==> Variable must be of type "Object".: 
$tBuffer.Text = $sText 
$tBuffer^ ERROR
->13:04:30 AutoIT3.exe ended.rc:1
+>13:04:31 AutoIt3Wrapper Finished
>Exit code: 1    Time: 3.830
#ce
Edited by magician13134
Posted (edited)

No, no, I can't do a loop and WinGetPos(), the position DOESN'T change until the mouse is dropped. I need to do actions in the time when the window is being resized. So there's no way to tell when a window has that grey border via Autoit?

do you mind to tell us why this is so important?

EDIT: I did not look at the sample code. SO, are we talking about a window you are creating with GuiCreate() or ANY window on your screen, e.g. firefox as shown in your screenshot?????

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Posted

Oh, and PaulIA, I reinstalled auto3lib and it works fine. I'm REALLY sorry about this. (I have some errors from before if you even care, but I doubt you do, since it's fixed...)

No problem. I'm glad that you got it working.

Anyway, this is what I got when I tried to run some of the examples from the help file...

>Running:(3.2.4.9):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\admin\Desktop\autoit\New AutoIt v3 Script.au3"

C:\PROGRA~1\AutoIt3\Include\A3LStructs.au3 (296) : ==> Variable must be of type "Object".:

$tBuffer.Text = $sText

$tBuffer^ ERROR

Ah, that's an easy one. You have an old copy of Auto3Lib installed somewhere on your machine. (Don't argue, just listen.) Back before the current production release, AutoIt had the ability to reference DllStruct elements by dot notation. Sadly, it was removed (by a person who shall remain nameless) :rolleyes: in the current production release of AutoIt.

Here's what you need to do to fix this:

1. Uninstall Auto3Lib.

2. Do a search on your hard drive and delete anything that fits A3L*.au3.

3. Install Auto3Lib again, making sure to specify the AutoIt directory. If you've installed AutoIt into it's default position (C:\Program Files\AutoIt3), just accept the installation point that Auto3Lib shows you (it will be the same).

If you have any further problems, don't hesitate to ask for help.

Auto3Lib: A library of over 1200 functions for AutoIt
Posted

And /dev/null, it was supposed to be any window, but that's ok, if there's no way to do it, I'll live, I probably wouldn't ever finish the program anyway.

Thanks for all your help both of you.

O.K. now I'm curious. What is your program all about?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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
×
×
  • Create New...