[Help] WoWs Window Handle menu

Shout-Out

User Tag List

Results 1 to 13 of 13
  1. #1
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] WoWs Window Handle

    EDIT: Just realized this should belong to C# section, sorry mods

    Everything seems to work fine with notepad, but for wow it doesnt...

    I'm using this:
    Code:
        [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
    
            [DllImport("User32.Dll", EntryPoint = "PostMessageA")]
            static extern bool PostMessage(IntPtr hWnd, uint msg, uint wParam, int lParam);
    
            [DllImport("user32.dll")]
            static extern byte VkKeyScan(char ch);
    
            IntPtr hWnd;
            private void GetWowWindowHandle()
            {
                Process[] procs = Process.GetProcessesByName("Wow");
                foreach (Process proc in procs)
                {
                    if (proc.MainWindowTitle == "World of Warcraft")
                    {
                        hWnd = FindWindowEx(proc.MainWindowHandle, IntPtr.Zero, null, null);
                    }
                }
            }
    The window handle just gives "0"...
    It's pretty odd because,
    Code:
    Process[] procs = Process.GetProcessesByName("WoW");
    foreach (Process proc in procs)
    {
        button3.Text = proc.MainWindowTitle.ToString();
    }
    returns World of Warcraft...

    Anyone that can point me out what i'm doing wrong?
    Last edited by WinRawr; 07-06-2009 at 11:57 AM.


    [Help] WoWs Window Handle
  2. #2
    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)
    EDIT: On a second thought. Use FindWindow. Pass IntPtr.Zero for the first param...
    Last edited by lanman92; 07-06-2009 at 12:20 PM.

  3. #3
    Quarters's Avatar Member
    Reputation
    16
    Join Date
    May 2009
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Replace the FindWindowEx and use FindWindow as lanman said, heres the code.

    Code:
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    I think this should work, I would check but I can't at the moment.

    Then I think you could simply implement it like so....

    Code:
    hWnd = FindWindow(null, "World of Warcraft");
    I'm only a beginner so..
    Last edited by Quarters; 07-06-2009 at 01:21 PM. Reason: Spelling Error

  4. #4
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Quarters! That worked :'D +Rep


  5. #5
    Quarters's Avatar Member
    Reputation
    16
    Join Date
    May 2009
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problems man, glad it helped. Thanks for the rep

  6. #6
    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)
    Seriously? You gave him the rep? Sigh. Oh well.

  7. #7
    Ugge's Avatar Member
    Reputation
    6
    Join Date
    Aug 2008
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if any keys except ctrl+c/v have to be pushed, you didnt help at all

  8. #8
    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)
    Btw, the reason it worked for notepad is because notepad has sub-"windows"(components).

  9. #9
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just curious FartBlast, asl? How long have you been programming? I saw your other app, the web launcher--> just curious, do you know much about programming (do u know what oop ==?), do you know why I used == and not = :P lol..sry, not trying to be rude...but if you don't even know how to program, it's not really possible to make a bot. For example, right now you're having trouble using API just to even find wow's window..i mean, anyone could have trouble with it..just asking. What are you going to do when you have a bunch of classes interacting and you don't know what oop is --> For example you're going to have to track characters, monsters, spells, mapPoints, etc.. For example I'm stuck atm trying to decide which classes should actually control which parts in the game(ie. --> by the time you're at this point people won't want to read all of your code and paste you back an answer, so unless you know the basics of programming you're going to get stuck basically at every new feature you try to add

    with all of that said...want to team up? lol...i'm doing this in vb.net but it's basically the same as C# and it would be cool to actually have a group of friends on something like msn instead of on a forum. so..pm me if you want

    ps. btw, i have little room to talk, because I'm only mid-level at programming and I get hung up a lot on specific oop stuff(Shared,Friend, etc), but I do know the basics and can solve ..most problems.

  10. #10
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i dont know that much about coding, happy now..? I'm lacking explaination because I dont get that much at school, That's why i'm here, Asking. and since when it is forbidden to ask shit, just relax... It never hurts looking into something that is abit far off for yourself isnt it? I learn from mistakes. Not from your egosentric posts explaining i should go back to hello world. My 2 cents.
    Last edited by WinRawr; 07-19-2009 at 04:15 PM. Reason: typo


  11. #11
    dook123's Avatar Active Member
    Reputation
    21
    Join Date
    Oct 2008
    Posts
    115
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    :)

    Good luck fartblast this is a fun project if you have continued with it.

    -Duke

  12. #12
    xzidez's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    136
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FindWindow

    Doublepost.. gawd.
    Last edited by xzidez; 09-21-2009 at 03:25 AM.

  13. #13
    xzidez's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    136
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FindWindow

    Hmm why do you want to use FindWindow instead of looping the processes?
    FindWindow will also return on a .. say. folder named world of warcraft thats opened.
    Also after you have retrieved the window handle you have to get the process id from that handle.

    The second code you pasted is much cleaner. I use something similar myself. Since I want to be able to inject my bot into multiple wow instances and want to decide which myself.

    IEnumerable<Process> processes = Process.GetProcesses().Where(c=>c.ProcessName.Equals("wow", StringComparison.OrdinalIgnoreCase);

    Dont have my exact code here but its something similar to that

Similar Threads

  1. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 2
    Last Post: 12-10-2024, 05:46 PM
  2. [Help] WoWs Window Handle
    By Mr.Zunz in forum WoW Memory Editing
    Replies: 4
    Last Post: 07-06-2009, 01:18 PM
  3. Windows media player helps wow load faster?
    By gladiator101 in forum World of Warcraft Guides
    Replies: 10
    Last Post: 01-30-2008, 04:56 AM
  4. Alot of realy helpful WoW guides
    By xps980 in forum World of Warcraft Guides
    Replies: 25
    Last Post: 04-22-2007, 03:27 PM
  5. Get past passwords to play WoW (windows xp)
    By eat mah -.- in forum Community Chat
    Replies: 9
    Last Post: 02-05-2007, 07:00 AM
All times are GMT -5. The time now is 01:10 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search