Inprocess GUI Options menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    PyGuy's Avatar Corporal
    Reputation
    14
    Join Date
    Jan 2011
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inprocess GUI Options

    I'm dusting off my inprocess dll after stepping away for a while and want to allow the user to interact with the dll from inside wow. I've done some simple testing on all of these options and I'd like some feedback as to what will work the best. I should say I'm using primarily using C# with an EndScene hook.
    1. Lua Frames - This is the method I'm currently using. I create a frame with some simple Lua controls which then make calls back to the app to do stuff (like hide/show waypoints, etc). The issues I have with this method are that 1) the lua stuff has to be recreated every time you zone and 2) it creates yet another language transition and debugging barrier.
    2. WinForms - This is what I think I'd like to do, but when I tried it, wow starting filling in my controls with portions of the rendered scene and I couldn't actually use it. Maybe someone knows what I did wrong?
    3. WPF - Apoc's blog does a nice job of list why I don't like this, so I'll just point you there. I can't remember if I had the same problem with Wow drawing over my controls or not when using WPF.
    4. External App with Pipe - I've also tried putting the GUI in a separate app and using a TCP/IP pipe for inter-process communication. This works, but 1) its slow, 2) you have to write wrappers for every call you want to make across the wire and 3) you either have really crappy frame rate or have to handle asynchronous call and response.


    Does anyone have any advice here? Things you've tried that worked well? Things that completely failed?

    Inprocess GUI Options
  2. #2
    caytchen's Avatar Contributor
    Reputation
    138
    Join Date
    Apr 2007
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You forgot the fifth option:

    5. Use D3D and one of the many GUI systems out there or build your own, which is probably recommended for compatibility. Draw directly in the game.

  3. #3
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can try WCF (example), it's similar to your option 4, but a lot better I guess.
    Last edited by TOM_RUS; 05-12-2011 at 05:40 AM.

  4. #4
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just stay OOP?
    https://tanaris4.com

  5. #5
    galpha's Avatar Member
    Reputation
    5
    Join Date
    Nov 2007
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I basically use is winforms. It's not as pretty as other GUI systems (WCF, DirectX), but it's BY far the easiest. I think it's a far better approach to go with something that works rock solid, then trying to have pretty stuffs that don't work well. Always a matter of how long and polished you want your GUI. I use a plugin system for my bot. My framework runs 100% in WoW, and I can load dll "on-demand" and that dll creates a GUI depending on the bot I use.

  6. #6
    PyGuy's Avatar Corporal
    Reputation
    14
    Join Date
    Jan 2011
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by caytchen View Post
    You forgot the fifth option:

    5. Use D3D and one of the many GUI systems out there or build your own, which is probably recommended for compatibility. Draw directly in the game.
    That's a very intriguing option. I don't think I'll use it because I use a small WoW window typically and I want to allow the bot GUI to get outside of that area and potentially to a different screen (I should have mentioned that as one of my objections to Lua too). Out of curiosity, how would you handle hardware events in this scenario? Is hooking more of the D3D api sufficient?

    ---------- Post added at 08:17 AM ---------- Previous post was at 08:11 AM ----------

    Originally Posted by TOM_RUS View Post
    You can try WCF (example), it's similar to your option 4, but a lot better I guess.
    I actually do use WCF for logging purposes. It is very nice in that you can write 'normal' code and it works just like you're calling functions in another program. My concern with it was that the time to box/send/unbox and then turn around and do it again the other way would add a significant number of cycles. Maybe I should just profile it instead of trying to pre-optimize.

    ---------- Post added at 08:20 AM ---------- Previous post was at 08:17 AM ----------

    Originally Posted by galpha View Post
    What I basically use is winforms. It's not as pretty as other GUI systems (WCF, DirectX), but it's BY far the easiest. I think it's a far better approach to go with something that works rock solid, then trying to have pretty stuffs that don't work well. Always a matter of how long and polished you want your GUI. I use a plugin system for my bot. My framework runs 100% in WoW, and I can load dll "on-demand" and that dll creates a GUI depending on the bot I use.
    I haven't looked at the WinForm API in a while, but if I remember correctly, you create a new thread for the GUI, create the winform and then start a message pump to run it? Did you ever have issues with WoW deciding your GUI looked like a nice place to render?

  7. #7
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    interprocess communication on the same computer with tcp/ip?! you should look into named pipes instead (IIRC there are a bunch of good articles on codeproject)

    @Caytchen: Mind naming a few of those systems? I personally haven't been able to find any managed DX gui systems besides one which was directed at mobile XNA and lacked documentation about writing a custom render engine which it did support...
    “Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.” - Rich Cook

  8. #8
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by beardoux View Post
    That's a very intriguing option. I don't think I'll use it because I use a small WoW window typically and I want to allow the bot GUI to get outside of that area and potentially to a different screen (I should have mentioned that as one of my objections to Lua too). Out of curiosity, how would you handle hardware events in this scenario? Is hooking more of the D3D api sufficient?
    I use a combination of both. A WPF application running a WCF service, each client connects to this service and has a DirectX Overlay as GUI. The external application manages everything that deals with multiple clients, the Overlay controls everything limited to that client.

    As for ingame GUI, it's not that hard to write your own control set, I found inspiration in Windows Forms and Java's SWING libraries for the code design. I draw my interface in an EndScene hook and use the client application's message pump (WindowProc) for the mouse and keyboard events.

    http://dl.dropbox.com/u/2754079/Wow%...0-17-21-32.jpg
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  9. #9
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wrote my own Gui framework that I uses a modular renderer system; You can get something similar by creating your own, or using something like GWEN @ gwen - GUI system aimed at games - Google Project Hosting.

    Good luck!


  10. #10
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by suicidity View Post
    I wrote my own Gui framework that I uses a modular renderer system; You can get something similar by creating your own, or using something like GWEN @ gwen - GUI system aimed at games - Google Project Hosting.

    Good luck!
    Is it possible to use this with C#? I don't have a lot of experience when dealing with both C++ and C# together. What would be the correct terminology for what I'm trying to do so I can look it up?

    Sorry for the bump btw..

  11. #11
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do some reading on C++/CLI wrapping. It's pretty simple, only time consuming.

  12. #12
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Do some reading on C++/CLI wrapping. It's pretty simple, only time consuming.
    Sooooooo tedious.

  13. #13
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Related question:

    Anyone know why you can't create a windows form from a managed module inside WoW? It crashes when I try to eject my module. AppDomain unloaded is what it says, but I haven't been able to find any information on that exception. I'm thinking it's a thread that isn't getting stopped when my form is destructed, so it crashes when I call AppDomain.Unload.

  14. #14
    Neffarian's Avatar Member
    Reputation
    -5
    Join Date
    Sep 2006
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude if your injected, use d3d, or Said hooked injected method
    It takes time, but after Setting up your FillRGB's and your lines, and make your classes. its not that bad.
    There really no simple way to do this. Check GD for Menu ideas.

  15. #15
    galpha's Avatar Member
    Reputation
    5
    Join Date
    Nov 2007
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Related question:

    Anyone know why you can't create a windows form from a managed module inside WoW? It crashes when I try to eject my module. AppDomain unloaded is what it says, but I haven't been able to find any information on that exception. I'm thinking it's a thread that isn't getting stopped when my form is destructed, so it crashes when I call AppDomain.Unload.
    Hum I don't have any problems loading a windows forms, nor unloading.

    I basically have a class PluginLoader that loads a dll file "on-demand" anytime during runtime. The said .dll file must implement the IPlugin interface and will call the IPlugin.OnLoad method of the interface. In the OnLoad method, I basically create a GUI.

    Code (not much error checking):

    Code:
    public class PluginLoader
        {
            IList<IPlugin> plugins;
    
            public PluginLoader()
            {
                plugins = new List<IPlugin>();
            }
    
            public void LoadPlugin(String path)
            {
                try
                {
                    Assembly assembly = Assembly.LoadFile(path);
    
                    Type[] typesInAssembly = assembly.GetTypes();
    
                    foreach (var type in typesInAssembly)
                    {
                        Type interfaceIPlugin = type.GetInterface("IPlugin");
    
                        if (interfaceIPlugin != null)
                        {
                            IPlugin addon = (IPlugin)Activator.CreateInstance(type);
                            plugins.Add(addon);
                            addon.OnLoad();
                        }
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.ToString());
                }
            }
    And in my plugins dll:

    Code:
    public void OnLoad()
            {
                GUI gui = new GUI();
                gui.OnBotStart += new EventHandler(gui_OnBotStart);
                gui.OnBotStop += new EventHandler(gui_OnBotStop);
                Application.EnableVisualStyles();
                Application.Run(gui);
            }
    Also, don't forget to cleanup when ejecting (remove detours, code caves, etc....).

Page 1 of 2 12 LastLast

Similar Threads

  1. How To: Operate GUI's & .exe's
    By Glynbeard in forum Community Chat
    Replies: 7
    Last Post: 10-30-2007, 08:17 AM
  2. WoW Custom GUI via BLP/MPQ edits?
    By Alexial in forum World of Warcraft General
    Replies: 0
    Last Post: 07-23-2007, 03:43 PM
  3. gnome male -->several options
    By trunk1985 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 06-12-2007, 12:07 AM
  4. [Program] Fishbot Refurbished - GUI
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 9
    Last Post: 12-05-2006, 06:12 AM
  5. Change the PM option?
    By Orlox in forum Suggestions
    Replies: 3
    Last Post: 11-29-2006, 09:42 PM
All times are GMT -5. The time now is 07:16 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search