Jump to content
Sign in to follow this  
DeathRow

PixelSearch for masked or HIDDEN windows ? Possible ?

Recommended Posts

DeathRow

How can I search for a certain color in a background or masked window by other windows( no minimized ), and get the color's relative window's coordinates ;) ??

Is it possible ? I appreciate any help....

Edited by DeathRow

Share this post


Link to post
Share on other sites
DeathRow

It is better to simply look at the controls of the application.

You better didn't answer...

I don't want to click anything ! I want to know the position of a certain image while the window is masked by other windows or minimized.

Thanks for your high quality post

Share this post


Link to post
Share on other sites
somdcomputerguy

PixelSearch will not work on a program that is minimized or not visible.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
DeathRow

PixelSearch will not work on a program that is minimized or not visible.

Yes,I observed, and even if is masked by other window it won't work.Pretty bad ;)

But is there any UDF for AutoIt that could do this ?

Or the API from MSDN ? I don't know how to search there...

Share this post


Link to post
Share on other sites
Bert

If it is a simple static window then are there controls on the window? Second, is it a standard window or a custom type such as a java window?

what happens when you use the AutoIt Window info tool on the window in question?

Edited by Bellicus

Share this post


Link to post
Share on other sites
DeathRow

Well I need to find certain colors in an image and to get the coordinates of them. I don't need any controls or buttons... and is a standard image.

And when I use AWindow Tool its finding the color

Thankyou for replies ... and I was looking towards the method of capturing a bitmap of the window in memory and to search invisible on that bitmap the position of the pixel I want to find = > finding the pixel on a hidden window ;)

Edited by DeathRow

Share this post


Link to post
Share on other sites
Bert

Your not making sense. You say "I need to find certain colors in an image and to get the coordinates of them" and say at the same time it is a static window. If it is static then why do you need to search for certain colors? Static means the image doesn't change. You imply the image changes. Does the image change? Either way would you care to share a screenshot of the image you are dealing with? That would make it much easier to see what we are dealing with.

Share this post


Link to post
Share on other sites
DeathRow

Your not making sense. You say "I need to find certain colors in an image and to get the coordinates of them" and say at the same time it is a static window. If it is static then why do you need to search for certain colors? Static means the image doesn't change. You imply the image changes. Does the image change? Either way would you care to share a screenshot of the image you are dealing with? That would make it much easier to see what we are dealing with.

O sorry I didn't know the real difference ;) Its a webbrowser window and I want to download many photos while hidden to not interference with my usual activity like playing a game. But the images aren't moving, the browser's window is sometimes increasing or decreasing in dimention. So everytime I need to ckeck for a certain color and get the coordinates while hidden or minimized

Edited by DeathRow

Share this post


Link to post
Share on other sites
Bert

That makes more sense. There is a different approach that would work much better for you seeing how you are downloading pictires. If you look at IE.au3 you can get all the pictures using

_IEImgGetCollection

look in the help file and you can see an example of how to get a collection. It would be a simple matter of downloading the images once you get the collection. That way you don't need to worry about the IE window interfering with anything else you are doing.

Share this post


Link to post
Share on other sites
DeathRow

That makes more sense. There is a different approach that would work much better for you seeing how you are downloading pictires. If you look at IE.au3 you can get all the pictures using

_IEImgGetCollection

look in the help file and you can see an example of how to get a collection. It would be a simple matter of downloading the images once you get the collection. That way you don't need to worry about the IE window interfering with anything else you are doing.

I forgot to mention that I can't use IE or Google Chrome and can't install that plug-in for FireFox to work with the UDF because of good reasons ;) ( long story....but trust me I can't )

I can use only Firefox lol, so I need to adapt for it ...

Share this post


Link to post
Share on other sites
DeathRow

Why can't you use IE? It is built into windows. Does your location or who owns the machine block you?

Unfortunetly...yes..;)( Thats why I cant use it

But please I don't want to deviate from the subject, How can I search for a specific pixel color in a background hidden window ??

Share this post


Link to post
Share on other sites
DeathRow

Then we can't help you for we will not be a part of you trying to evade or bypass security. Either use it for legit reasons with the owner's blessing or don't do it at all. Your choice.

What do you mean by bypass security ? What security ??

You didn't understand what Im asking for, I want to know how can I find a pixel color in a background window, the same subject was posted in other threads too but I don't know how to apply it, I appreciate if anyone could help me.

Share this post


Link to post
Share on other sites
MrMitchell

You didn't understand what Im asking for, I want to know how can I find a pixel color in a background window, the same subject was posted in other threads too but I don't know how to apply it, I appreciate if anyone could help me.

Manadar's (and Greenseed's) example.au3 and _PixelGetColor.au3 provide working example of how to basically take a screenshot to memory then pixelsearch it. You've previously linked to it, here it is again. After reading about it then running it, seems to work fine for me. You need to temporarily bring up the window to search so you can get a screenshot, then hide the window, then you can search the screenshot later on in your script. For me I brought Firefox to the foreground-maximized, took the "screenshot", then hid the Firefox window again. I then searched the 10x10 pixel box in the top left corner (starting at 0,0) for the color 0xDCCEBF and found it at several locations: 0,3; 1,3; and 2,3.

Edited by MrMitchell

Share this post


Link to post
Share on other sites
Bert

What do you mean by bypass security ? What security ??

You didn't understand what Im asking for, I want to know how can I find a pixel color in a background window, the same subject was posted in other threads too but I don't know how to apply it, I appreciate if anyone could help me.

You said yes to this question: "Does your location or who owns the machine block you?"

That means you are trying to get past a security measure.

Understand now?

Share this post


Link to post
Share on other sites
DeathRow

You said yes to this question: "Does your location or who owns the machine block you?"

That means you are trying to get past a security measure.

Understand now?

Yes I said that, and its true, but you understand me wrong, its my computer and my parents blocked my computer with limited user account( they are paranoid ) and they say to not use IE and uninstalled it ;) and with limited access I cant install it :) so I really need to do it on the default browser ff

Edited by DeathRow

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • nooneclose
      By nooneclose
      My program has to first search for names in Column D that do not match up with column C. I got that search to work using arrays. It was slow and I could not figure out how to delete them so I just manually put coded the names that do not belong. I found their cell location but I do not know how to store that location and delete it.
      This is what I have so far.
      Local $NameToDelete1[6]  = _Excel_RangeFind($OpenWorkbook, "Smith, Bill") _ArrayDisplay($NameToDelete1, "Excel UDF: _Excel_RangeFind Example 1", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") _Excel_RangeDelete($OpenWorkbook.ActiveSheet, $NameToDelete1[2], $xlShiftUp)  
      Please help, I wanted to have this program done yesterday but I did not see this problem until yesterday. 
    • Skeletor
      By Skeletor
      Hi All,
      While creating a few excel spreadsheets using AutoIt, I came across something which to my limiting time to research the forums I don't anyone has mentioned. 
      The color pallettes are reversed. 
      Huge shock to me.
       
      I wanted to produce a red row but kept on getting blue. 
      Seems like 0xFF0000 was red on the charts but when running the script, I got blue. 
      I then played around with the colors, and after a few tries, I finally got Red. 
      Reversed the FF0000 and the result is 0000FF.
       
      So for Excel compared to Html
      0000FF (Red) - Excel
      0000FF (Blue) - Html

      FFFF00 (Cyan) - Excel
      FFFF00(Yellow) - Html
       
    • xtcislove
      By xtcislove
      Hello,
      i stuck again,
      Im using this function to create a treeview from root dir.
       
      ;https://autoit.de/index.php?thread/86082-treeview-root-verbergen/&postID=691139#post691139 #include <File.au3> #include <WindowsConstants.au3> Global $sPath = @ScriptDir Global $hGui = GUICreate('TreeView-Example', 400, 600) Global $idTreeView = GUICtrlCreateTreeView(10, 10, 380, 580, Default, $WS_EX_CLIENTEDGE) GUISetState() _CreatePath($sPath, $idTreeView) Do Until GUIGetMsg() = -3 Func _CreatePath($sPath, $idParent) Local $aFolder, $aFiles, $idItem If StringRight($sPath, 1) <> '\' Then $sPath &= '\' $aFolder = _FileListToArray($sPath, '*', $FLTA_FOLDERS) If Not @error Then For $i = 1 To $aFolder[0] $idItem = GUICtrlCreateTreeViewItem($aFolder[$i], $idParent) _CreatePath($sPath & $aFolder[$i], $idItem) Next EndIf $aFiles = _FileListToArray($sPath, '*', $FLTA_FILES) If @error Then Return For $i = 1 To $aFiles[0] $idItem = GUICtrlCreateTreeViewItem($aFiles[$i], $idParent) Next EndFunc Folder Structure:

      Folder1
      Folder2
      Folder3
      If a file exists in multiple folders, i like to color it red, if not green. 

      I know how to do this for files, but nut for the folders.

      Because if there is only 1 file in Folder2 that is also in Folder1 that it should only color this single file red, inlcuding its whole tree.

      The Folder1 and Folder2 should be red in this case, too. Other files and trees should stay green.
       
      Edit:
      Basically i like to color a file and its belonging tree red if the file exists more than 1 time.
    • bbProg
      By bbProg
      Hi,
       
      how can I wait activate for windows with information as in the photos attached?
      Class is not being recognized by the script.
       
      thanks in advanced.



    • AndyS19
      By AndyS19
      I'm trying to implement a Ctl-F popup box that looks something like the one that Notepad uses, but I'm not havine much luck.  I intend to get it working, then beef up the popup's contents to add several checkboxes, buttons and radio boxes.
      What my example code does is to use InputBox(), but that's not what I want.
      Here is my test code:
      #include <Array.au3> #include <GUIConstantsEx.au3> #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("WinTitleMatchMode", -2) Global $hGUI _Main() Func _Main() $hGUI = GUICreate("Test ^F", 300, 200) setupSpecialKeysHandlers() GUISetOnEvent($GUI_EVENT_CLOSE, "Event_GUIClose") GUISetState() While (1) Sleep(157) WEnd EndFunc ;==>_Main Func handle_CTRL_F_key() Local $str $str = InputBox("Search", "Enter the string to search for:") ConsoleWrite("+++: $str ==>" & $str & "<==" & @CRLF) EndFunc ;==>handle_CTRL_F_key Func ExitStageLeft() Exit (99) EndFunc ;==>ExitStageLeft Func Event_GUIClose() Exit (1) EndFunc ;==>Event_GUIClose Func setupSpecialKeysHandlers() Local $ar, $parts, $key, $handler, $id Local $aAccelKeys[1][2] ; Create a table of Special keys and their handlers $ar = StringSplit("", "") _ArrayAdd($ar, "^f - handle_CTRL_F_key ") ReDim $aAccelKeys[UBound($ar) - 1][2] ; Now, create $aAccelKeys array with the table data. ; For each entry, create a Dummy GUI and associate its ; ID with the special key. For $ndx = 1 To UBound($ar) - 1 $parts = StringSplit($ar[$ndx], "-", 2) $key = StringStripWS($parts[0], 8) $handler = StringStripWS($parts[1], 8) $id = GUICtrlCreateDummy() $aAccelKeys[$ndx - 1][0] = $key $aAccelKeys[$ndx - 1][1] = $id GUICtrlSetOnEvent($id, $handler) Next GUISetAccelerators($aAccelKeys) ; Setup the Special keys hooks EndFunc ;==>setupSpecialKeysHandlers  
×