Results 1 to 10 of 10

Thread: findwindow

  1. #1
    Guest

    Question

    Code:
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    how do I use this?
    also, what is it used for, when it finds the window, does it open it, or does it have to be open to find the window?
    help me please.

  2. #2
    Guest
    YES, I am addicted

  3. #3
    Guest

    i just learned this

    i just learned how to use this

    you would do this:

    a = FindWindow(windowclassname,windowcaption)

    and if this is succesful then "a" will hold the handle for the window. for example, i am making a program for napster and i need to know its handle, so i would put this line of code in:

    napster_handle = FindWindow("napster",vbNullString)

    and now napster_handle will hold the handle for napsters window. hope i helped out. check out http://www.vbapi.com

  4. #4
    Guest
    thanks,
    but how do you know the windowclassname?

  5. #5
    Guest
    well i used a spy program to find the class name of napster, but there is a way to find it with coding. i dont know the code off hand, but it is fairly simple. what the code does is follow your mouse cursor, and with the function "GetClassNameA" you can retrieve the window class. but im not sure how to get your mouse cursor position outside of the form, so i cant give the code. i hope this helps.

    check out http://www.vbapi.com for a lot more help on this kind of stuff.

  6. #6
    Guest

    Talking

    I've got a program that gives you the class AND the window handle

  7. #7
    Guest
    after finding the window, how do I manipulate it and open it using the handle?

  8. #8
    Guest
    well you have to be more specific, but ill give you one example. for instance once you get the window handle of the window you want to play around with, then use the SetWindowText function.

    Call SetWindowText(windowhandle, "anything you want")

    now the caption of that window will be "anything you want". so that is a cool way to mess around with programs.

  9. #9
    Guest
    THANK YOU....
    it worked good.... but it doesnt need the call setwindowtext
    just
    Code:
    SetWindowText 1208, "My First Sucessful API Call :D "
    1208 is the handle for my DUN connection window...
    can someone list all of the calls related to this kind of thing?

  10. #10
    Guest
    here is a small list of very simple API functions that work by just knowing the handle of the window:

    Call EnableWindow(windowhandle, True/False) depending on if that window is enabled or disabled.

    Call ShowWindow(windowhandle, True/False) depending if you want to hide or show it.

    there are many more stuff, but those are just 2 of them. plus im new to API so i dont know many functions.

Posting Permissions

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



Click Here to Expand Forum to Full Width