Jump to content

Window Finder


Lazycat
 Share

Recommended Posts

Don't sure, maybe similar example was already posted (but I not found). If so, just forget it <_<

This is window finder, similar one used in the Au3Info. It was done for one of Koda support files, but this can be useful separately for pointing windows from scripts.

post-126-1193429843_thumb.png

window_finder.zip

Link to comment
Share on other sites

  • 8 months later...

thank you so much for sharing LazyCat! I'm having problems with the code however. When I run it by selecting "Go" in the SCITE editor, I get the errors below. Can you please help me to figure out what I should do to fix this? Thanks you!

WARNING: $SS_RIGHT: possibly used before declaration.

GUICtrlCreateLabel("Title:", 101, 18, 27, 17, $SS_RIGHT)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

WARNING: $SS_CENTER: possibly used before declaration.

$hLabelTitle = GUICtrlCreateLabel("", 133, 18, 436, 17, BitOR($SS_CENTER,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

WARNING: $SS_GRAYFRAME: possibly used before declaration.

$hLabelTitle = GUICtrlCreateLabel("", 133, 18, 436, 17, BitOR($SS_CENTER,$SS_RIGHT,$SS_GRAYFRAME,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

WARNING: $SS_WHITEFRAME: possibly used before declaration.

$hLabelTitle = GUICtrlCreateLabel("", 133, 18, 436, 17, BitOR($SS_CENTER,$SS_RIGHT,$SS_GRAYFRAME,$SS_WHITEFRAME,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~^

WARNING: $SS_SIMPLE: possibly used before declaration.

$hLabelTitle = GUICtrlCreateLabel("", 133, 18, 436, 17, BitOR($SS_CENTER,$SS_RIGHT,$SS_GRAYFRAME,$SS_WHITEFRAME,$SS_SIMPLE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~^

WARNING: $SS_NOTIFY: possibly used before declaration.

$hTargetPic = GUICtrlCreateIcon($ICON_TARGET_FULL, 0, 24, 20, 32, 32, BitOR($SS_NOTIFY,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

WARNING: $WS_GROUP: possibly used before declaration.

$hTargetPic = GUICtrlCreateIcon($ICON_TARGET_FULL, 0, 24, 20, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

ERROR: $SS_RIGHT: undeclared global variable.

GUICtrlCreateLabel("Title:", 101, 18, 27, 17, $SS_RIGHT)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Link to comment
Share on other sites

Ok, sorry...I figured this out now...it looks like I'm using a newer version of AutoIT and I needed to add these #include statements:

#include <WindowsConstants.au3>

#include <Constants.au3>

#include <GuiConstants.au3>

#include <StaticConstants.au3>

After I did that, it's working now! Thanks! Excellent!

Link to comment
Share on other sites

  • 5 months later...

Lazycat,

This is a great post. I was wondering how the finder in Au3info worked and this helps a lot. I am a newb so there is much I don't udnerstand ... let me start at the start. I searched the help file for information on "WriteResource." I could not find anything and have no idea what that part of the script is doing. I realize it says "Initializing resources" but would you mind explaining what is happening there?

Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

I searched the help file for information on "WriteResource." I could not find anything and have no idea what that part of the script is doing. I realize it says "Initializing resources" but would you mind explaining what is happening there?

If you carefully look the script, you will find this function definition near the bottom. This function just write required images, that stored in hex form, to files in the temporary folder. This way script was made single-file only.
Link to comment
Share on other sites

Lazycat,

Thanks for the information. Sorry for the confusion. I am not at all familiar with the use of hex values. It looked completely foreign to me. I have a good place to start looking stuff up now ... info on hex values. Thanks for taking the time to answer my questions.

Jayme

If you carefully look the script, you will find this function definition near the bottom. This function just write required images, that stored in hex form, to files in the temporary folder. This way script was made single-file only.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

LC,

Sorry, one more question. It looks like the 12.24.08 release (v3.3.0.0 ) breaks this script. I saw hugobossv8's post from 7.28.08. Those includes worked and I was up and running. Then I installed v3.3.0.0 and I got the following error:

C:\Documents and Settings\Jayme\Desktop\Window Finder.au3(69,29) : ERROR: $WM_MOUSEMOVE previously declared as a 'Const'

Global $WM_MOUSEMOVE = 0x200

~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jayme\Desktop\Window Finder.au3(70,29) : ERROR: $WM_LBUTTONUP previously declared as a 'Const'

Global $WM_LBUTTONUP = 0x202

~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

I am assuming it is something in the new release. Am I doing something wrong?

Lazycat,

Thanks for the information. Sorry for the confusion. I am not at all familiar with the use of hex values. It looked completely foreign to me. I have a good place to start looking stuff up now ... info on hex values. Thanks for taking the time to answer my questions.

Jayme

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

LC,

Sorry, one more question. It looks like the 12.24.08 release (v3.3.0.0 ) breaks this script. I saw hugobossv8's post from 7.28.08. Those includes worked and I was up and running. Then I installed v3.3.0.0 and I got the following error:

C:\Documents and Settings\Jayme\Desktop\Window Finder.au3(69,29) : ERROR: $WM_MOUSEMOVE previously declared as a 'Const'

Global $WM_MOUSEMOVE = 0x200

~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jayme\Desktop\Window Finder.au3(70,29) : ERROR: $WM_LBUTTONUP previously declared as a 'Const'

Global $WM_LBUTTONUP = 0x202

~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

I am assuming it is something in the new release. Am I doing something wrong?

[center]I LOVE ALGERIA .... ;-)[/center]
Link to comment
Share on other sites

  • 4 weeks later...

ALG:

I wrote to LazyCat and he helped me with the fix. I had to remove all the styles from the GUI such as: SS_RIGHT,SS_CENTER,GRAYFRAME,etc. (everything that came up as an error when it ran). Once they were gone, it worked. Thanks again to LazyCat for posting this.

JFish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

  • 5 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...