Jump to content

background colors

Recommended Posts

Hi guys,

I am very familiar with pixel search, as i use it all the time altering my desktop stuff. I quite enjoy it actually, its great. I have a question though. So if i have a desktop icon, i want to throw it in the trash bin. If i dont know the color that it will be, but i know the color of the desktop background, how do i find the icons? Here is how i would do it if i knew the colors.

while 1

    $Desktop_Icon = PixelSearch(618, 68, 929, 299, 0xAB1A00, 10)
    If IsArray($Desktop_Icon) then
        MouseClickDrag("left", $Desktop_Icon[0], $Desktop_Icon[1],400 , 200, 1)  ;400,200 is my trash bin

I know what you are all thinking, that it would be much easier doing it other ways, but i like tinkering with the pixelsearch. Thanks guys!

Link to comment
Share on other sites

I haven't tried this, but from the help file - Failure: Sets @error to 1 if color is not found. So perhaps you can adjust the coordinates of the previous successful search to get the icon coordinates, and drag from there. Otherwise I don't know!

However it sounds like a very unpredictable method of cleaning up your desktop. Are you sure that's what you are trying to do? I would advise against it: Things could easily go wrong. :(

Link to comment
Share on other sites

Thats the problem, is that there wont be an error due to the background being there. I guess there is no way of doing like a reverse pixel search such that if a color is there other than the one your looking for you get a response?

Link to comment
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

  • Recently Browsing   0 members

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