Results 1 to 9 of 9

Thread: Find a Window

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Find a Window

    Hey,
    how can you find and use a client window with simba. Lets say by size or by title.

    Is there an inbuild function ?

  2. #2
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    you could make the icon as a DTM then adjust accordingly using MouseSetClientArea

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Don't use DTM's.. They're over suggested.. It's not the answer to everything. Not sure why anyone would use a DTM to find a window. No disrespect to the suggester above, but I wouldn't use a DTM..

    Simba Code:
    function FindWindow(TitlePrefix: String): Boolean;
    var
      T: TSysProcArr;
      I: Integer;
    begin
      T:= GetProcesses();
      for I := 0 to high(T) do
        if ExecRegExpr(TitlePrefix, T[i].Title) then   //If you aren't familiar with RegExpressions, use (Pos(...) > 0)
          Result := True;
    end;


    OR use an extension:

    PHP Code:
    function FindWindow(ClassNameWindowNamePChar): HWNDexternal 'FindWindowA@User32.dll'

    function FindSmartHWND;   //Returns a handle to the found window..
    var
    SmartHWND;
    begin
      Smart
    := FindWindow('SunAwtFrame''Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100');
      
    result:= Smart;
    end
    For other extension stuff, view my extension here: http://villavu.com/forum/showthread.php?t=65657
    Last edited by Brandon; 09-26-2012 at 09:16 PM.
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks for the replies.

    Can you set the found window as new client for simba ?

  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Thanks for the replies.

    Can you set the found window as new client for simba ?

    Simba Code:
    function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
    var
      T: TSysProcArr;
      I: Integer;
    begin
      T:= GetProcesses();
      for I := 0 to high(T) do
        if ExecRegExpr(TitlePrefix, T[i].Title) then
        begin
          Result := True;
          if SetAsTarget then
          begin
            SetTarget(T[i]);
            ActivateClient;
          end;
        end;
    end;
    I am Ggzz..
    Hackintosher

  6. #6
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    So doing this:
    Simba Code:
    {$IFDEF SMART}
    //six hour fix, etc.
    {$ELSE}
    FindAndSetTarget('Runescape'; True);
    {$ENDIF}
    Would work if we didn't have SMART defined but had an RS window open, whose name Has Runescape at some point? Or does the word have to be at the beginning of the title?
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  7. #7
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thats working great *-* thanks so much.

    One more question ... Can you find Child elements in Windows, Like Edit fields and stuff. And Can you send text to those ? With like "Post Message" ???

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Thats working great *-* thanks so much.

    One more question ... Can you find Child elements in Windows, Like Edit fields and stuff. And Can you send text to those ? With like "Post Message" ???
    With an extension that would be no problem. With Simba I don't think so :S

    Maybe a plugin? Why not make a plugin that does all that stuff and returns the handles?

    Getting ChildWindow handles would be quite the task in Lape and Simba since those are windows extensions.

    Perhaps if Simba could use Typedefs to get exported functions from a DLL. Other than that, an Extension or a plugin WILL be required.

    I remember writing an "extension" called SmartChat that does this. I believe Daniel has also written a "plugin" that contains most WinAPI functions and you just load it and use it.
    I am Ggzz..
    Hackintosher

  9. #9
    Join Date
    Jan 2008
    Posts
    33
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hi!

    Can you also CLOSE, MINIMIZE, MAXIMIZE a target window ??

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •