LibFunc Iconic Window

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

LibFunc Iconic Window

Post by PepsiHog » Sun Jul 05, 2020 3:48 pm

Hello Everyone,

Two things.
I am trying to find a reference on Microsoft for LibFunc with no luck. Please share the link if you have or know it.

And could someone give me an example of minimizing a window using LibFunc? I know I've used it, and I seached my macros, with no luck. I know it's IsWindowIconic or something of that nature. And then some other function to actually min/max the window.

I have this macro I wrote. I use the stand-alone script editor. When the macro runs, I have it wait 10 seconds, so I can minimize the editor before it starts to do it's thing. I want to eliminate that need.

I am trying to not have to automate the command. Ya' know....mousemove here, click that and such. I tried WindowAction. I don't think it can do it to itself.

So I guess what I am saying is I really, really, really want to use LibFunc for this. :lol:

Thanks in advance for helping,
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: LibFunc Iconic Window

Post by Grovkillen » Sun Jul 05, 2020 5:15 pm

Ok, you specifically asked for LibFunc but here's my take when I'm doing the same thing.

Code: Select all

GetActiveWindow>WINDOW_NAME,,,,,
Run>%SCRIPT_DIR%\Minimize.exe /TITLE="%WINDOW_NAME%"

//compile "Minimize.exe" with the following code...
//WindowAction>2,%title%
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: LibFunc Iconic Window

Post by Grovkillen » Mon Jul 06, 2020 7:28 am

Here's your wish fulfilled :)

Code: Select all

Let>WIN_USEHANDLE=1
GetActiveWindow>strTitle,nXPos,nYPos,,
LibFunc>user32,ShowWindow,res,%strTitle%,2
More found here: https://docs.microsoft.com/en-us/window ... showwindow
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: LibFunc Iconic Window

Post by Grovkillen » Mon Jul 06, 2020 9:09 am

And here's the iconic call you remembered:

Code: Select all

Let>WIN_USEHANDLE=1
GetActiveWindow>strTitle,nXPos,nYPos,,
//LibFunc>user32,ShowWindow,res,%strTitle%,2
LibFunc>user32,IsIconic,isMinimized,%strTitle%
If>isMinimized=0
  MDL>Window is NOT minimized
Else>
  MDL>Window is minimized
Endif>
https://docs.microsoft.com/en-us/window ... r-isiconic
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: LibFunc Iconic Window

Post by PepsiHog » Mon Jul 06, 2020 12:36 pm

@ Grovkillen,
Thanks for the help. I was thinking it might come down to that. But wasn't expecting anyone(you) to provide the script. Simply because, as you said, I was asking for LibFunc. However, I am glad you did. I do not believe LibFunc would be able to do it either without being a separate script.

But I must give you props. I would have written the script for the task at hand, end of story. You, on the other hand, made it a tool by passing the window's name to it. It has given me the idea to create a folder with different tools like minimize.exe.

I actually saw your post last night. I didn't see the new posts until just now. I just logged in to thank you for the first script. Last night my eyes wouldn't stay open, so I planned to post this morning. I clicked the "post" button without looking.

Thanks for ALL the help. Did you by chance post the link? (Haven't really looked yet.)

PepsiHog

[edit] - Yep you did. Thanks for that.
[edit,edit] - LibFunc does work. Cool. You helped me on two fronts. I'll use LibFunc and create my tool folder. Thank you. Your awesome!
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: LibFunc Iconic Window

Post by Grovkillen » Mon Jul 06, 2020 3:33 pm

Happy to have helped :D
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts