LuciMaldonado / shimeji-ee

Automatically exported from code.google.com/p/shimeji-ee
0 stars 0 forks source link

Interact With Non-Browsers #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Right now, Shimeji-ee can only interact (throw, climb, etc...) with browser 
windows (IE, Firefox, Chrome.)  It would be nice if Shimeji-ee could interact 
with other types of windows.

Original issue reported on code.google.com by relic...@gmail.com on 6 Nov 2010 at 8:44

GoogleCodeExporter commented 8 years ago
This would be awesome.

Original comment by MistahB...@yahoo.com on 17 Nov 2011 at 7:42

GoogleCodeExporter commented 8 years ago
it seems to me that the patch made by Liz
is already in the subversion code repo

-----------
r39 by relic.nt on Sep 11, 2011   Diff

Adding contributed code, included
conversion code and support for other
window interaction.
-----------

http://code.google.com/p/shimeji-ee/source/browse/trunk/src_win/com/group_finity
/mascot/win/WindowsEnvironment.java

Original comment by t...@anpa.nl on 19 Nov 2011 at 12:32

GoogleCodeExporter commented 8 years ago
But add where?

Original comment by nganhang...@gmail.com on 15 Feb 2013 at 12:38

GoogleCodeExporter commented 8 years ago
I am rather curious as to how you implement the code too...

Original comment by jeff10...@gmail.com on 7 Mar 2013 at 10:32

GoogleCodeExporter commented 8 years ago
The code has to be compiled with a java compiler. I used eclipse to make a jar 
(it was broken, but had the class file I needed), then opened both jars with 
ALZip and replaced the class file.

Remember to make windows.txt in the same directory as the jar.

Original comment by ShowMeTh...@gmail.com on 11 Mar 2013 at 6:57

GoogleCodeExporter commented 8 years ago
how do i integrate the code to the jar file? i am new to this so please de 
detailed

Original comment by alexande...@gmail.com on 18 Mar 2014 at 7:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
hi, i have solved this! =*^_^*=

prehistory:
i have failed to compile jar with eclipse and that was fucking not easy process 
resulting to aprox 24 hours waste (java diff vm version issues in eclipse).

But i succeed in compiling using NetBeans ^_^ but partially - i didnot get .jar 
but i Did get separate ".class" files, than i have placed updated class to the 
original shimeji-ee jar and in result i now have my own version which checks 
not only window names but also classes! =*^_^*=

in "windows.txt" and "windows_classes.txt" by specifying "*" instead of window 
name or class name - u can have in result shimeji to interact with ANY window. 
but i reccomend to specify windows explicitly. i have used Dexpot (virtual 
desktop pretty powerfull btw) to findout window classes ^_^

ok here it is (attachment). i have no time to make full instruction but decided 
to attach INDEED REALLY FUCKING WORKING version of shimeji-ee with this issue 
fixed.

attachment also has "src_netbeans_shimeji-ee_custom.7z" NetBeans project ready 
to compilation. 

also about my custom shimeji - simply run "RUN VBS^_^.bat" and shimeji will be 
running without window at taskbar.

mascots in attachment are modified - they really often will jump on active 
window ^_^ this is can really warm up your heart! =*^_^*=

IMPORTANT: to run shimeji-ee in the attachment you first need to download old 
java version to
"C:\portable\Java 6 u 22\"
(see "Shimeji-ee.bat" for moar details)

also here is the code, file "WindowsEnvironment.java":

[code]

    private static boolean isIE(final Pointer ie) {

        final Boolean cache = ieCache.get(ie);
        if (cache != null) {
            return cache;
        }

        // title
        final char[] title = new char[1024];
        final int titleLength = User32.INSTANCE.GetWindowTextW(ie, title, 1024);
                try {BufferedReader br = new BufferedReader(new FileReader("windows.txt"));
                    String window;while ((window = br.readLine()) != null) {
                        if (window=="*" || new String(title, 0, titleLength).contains(window)) {
            ieCache.put(ie, true);
            return true;
                        }}br.close();
                }catch(FileNotFoundException e){Main.showError( "windows.txt not found" );
                }catch(IOException e){Main.showError("IOException.");}
        // class 
        final char[] className = new char[1024];
        final int classNameLength = User32.INSTANCE.GetClassNameW(ie, className, 1024);

                try {BufferedReader br = new BufferedReader(new FileReader("windows_classes.txt"));
                    String windowcn;while ((windowcn = br.readLine()) != null) {
                        if (windowcn=="*" || new String(className, 0, classNameLength).contains(windowcn)) {
            ieCache.put(ie, true);
            return true;
                        }}br.close();
                }catch(FileNotFoundException e){Main.showError( "windows_classes.txt not found" );
                }catch(IOException e){Main.showError("IOException.");}

        ieCache.put(ie, false);
        return false;
    }

[/code]

Original comment by somelega...@gmail.com on 18 Aug 2014 at 9:37

Attachments:

GoogleCodeExporter commented 8 years ago
Great Job somelega your work is fantastic

Original comment by Stephen3...@gmail.com on 18 Aug 2014 at 10:39