Change focus?

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Change focus?

#1 Post by 3cmSailorfuku » Thu May 22, 2008 10:15 am

I haven't found any useable function in the micromacro documentation, so I wonder if theres a function to change the current focus, like focusWindow("Mozilla Firefox");.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Change focus?

#2 Post by Administrator » Thu May 22, 2008 3:26 pm

Great idea. I've added this and uploaded it to the main page (built with LuaCoco -- since it appears stable enough).

The function is showWindow(window, command)
Where window is obtained with findWindow(), and command is one of the following:
  • sw.show -- activate (show and set focus to) the window
    sw.shownormal -- activate and restore to original size and position
    sw.hide -- hide the window
    sw.forceminimize -- forcefully minimize (also hides the window)
    sw.minimize -- minimize the window
    sw.maximize -- activate and maximize the window
    sw.restore -- activate the window and restore to original size and position (used after minimizing)

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Change focus?

#3 Post by lolita » Wed Jan 29, 2014 7:37 am

i was searching forum, but didnt find,
so is there comand for set window size and position?
Life is a journey, not destination :D

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Change focus?

#4 Post by lisa » Wed Jan 29, 2014 9:15 am

for MM you can use

Code: Select all

setConsoleAttributes(Width,Height)
values are in characters, so if you do 40,40 it won't look like a square because characters are taller than they are wide.


For any window you can use this for its position

setWindowPos(window, wx, wy, ww, wh, t)
info on it here
http://www.solarstrike.net/wiki/index.p ... wPos.28.29
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Change focus?

#5 Post by lolita » Thu Jan 30, 2014 4:42 am

thanks
Life is a journey, not destination :D

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests