Jump to content


Photo

Mwin Dll


  • Please log in to reply
9 replies to this topic

#1 cswenson1

cswenson1

    CS Games

  • New Member
  • 725 posts

Posted 27 February 2009 - 05:18 AM

With this dll you can get and set the x,y,w,h of another window. Also, this dll is not fool proof and will fail if there are two windows with the same title.

Functions:
mwin_init()
mwin_get_handle("Window Name/Title")
mwin_get_handle_class("Window Name/Title","Window's Class name")
mwin_set_win(handle,x,y,w,h)
mwin_get_winx(handle)
mwin_get_winy(handle)
mwin_get_winw(handle)
mwin_get_winh(handle)

Download: Posted Image
The download includes the gmk, dll, and exe

Please give credit to cswenson1 and freaked if used.

Enjoy and give feedback!
Thanks,
-Cswenson1

Edited by cswenson1, 06 March 2009 - 03:09 AM.

  • 1

#2 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 28 February 2009 - 01:21 PM

Pretty good, but you should allow users to specify a class name to narrow the search down.
  • 0

#3 cswenson1

cswenson1

    CS Games

  • New Member
  • 725 posts

Posted 28 February 2009 - 05:41 PM

Pretty good, but you should allow users to specify a class name to narrow the search down.

What is a class name and how would that narrow the search down?

Edited by cswenson1, 28 February 2009 - 05:42 PM.

  • 0

#4 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 28 February 2009 - 07:24 PM

It's the first parameter in FindWindow: http://msdn.microsof...y/ms633499.aspx

Both of the arguments are optional, see this page for more information on classes.
  • 0

#5 cswenson1

cswenson1

    CS Games

  • New Member
  • 725 posts

Posted 03 March 2009 - 11:23 PM

I still dont understand how it works, how does it narrow down a windows title by saying whether its a scroll bar or button or not
  • 0

#6 freaked

freaked

    freak up!

  • New Member
  • 890 posts

Posted 04 March 2009 - 06:21 AM

Consider this.
You have two windows having the title "Notepad".
One is the "official one" and the other is a Java program written by some one to see how swing works.
Now, someone using this dll will want to set the Java Notepad window to size 100,100.
In the title parameter he puts "Notepad".
When he runs it the official notepad window shrinks to 100,100.

If you provide class based search, it will help to narrow down the search since both windows can have same titles but not the same class names.

If the class name of the java notepad window is "SwingWin32WindowClass" then putting it alongside "Notepad" will shring the Java window to size 100,100, and will leave the real notepad window untouched.
  • 0

#7 cswenson1

cswenson1

    CS Games

  • New Member
  • 725 posts

Posted 04 March 2009 - 10:34 PM

Thanks freaked! I'll try that later when I get on my other computer. But just for the sake of learing, how did you get "SwingWin32WindowClass"? I understand that swing has to do with java, but how would it work if i made a c++ win32 window or a visual basic window called notepad and the real one?
  • 0

#8 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 05 March 2009 - 01:17 AM

CreateWindowEx

lpCLassName is used when creating windowed applications. Now, I do not know how the RAD (VB, Delphi, etc.) applications handle their window classes, but you don't need the class info, the user needs to know.
  • 0

#9 freaked

freaked

    freak up!

  • New Member
  • 890 posts

Posted 05 March 2009 - 05:57 AM

Thanks freaked! I'll try that later when I get on my other computer. But just for the sake of learing, how did you get "SwingWin32WindowClass"? I understand that swing has to do with java, but how would it work if i made a c++ win32 window or a visual basic window called notepad and the real one?

If you want to find the class names of other windows, use a tool called Spy++.
It will let you find the Handle, class name, process id, and other stuff for windows.
NB: Every Control is a window.
And as for "SwingWin32WindowClass", I made that up. :blink:
  • 0

#10 cswenson1

cswenson1

    CS Games

  • New Member
  • 725 posts

Posted 06 March 2009 - 03:11 AM

Ok, thanks! I downloaded Spy++ and got the class names of like paint and notepad. Anyways, i added another function to allow the user to input the title and the class name if they want. Thanks for your guys help in explaining class names!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users