Sign in to follow this  
Followers 0
Buffo

Run with @SW_HIDE doesn't hide window

10 posts in this topic

Hi,

This code will not hide the application window. Why?

Run("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1", "", @SW_HIDE)

If it helps:

OS: WinXP Pro SP2

AutoIt3: v3.1.1.87beta

Regards,

Buffo

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

This code will not hide the application window. Why?

Run("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1", "", @SW_HIDE)

If it helps:

OS: WinXP Pro SP2

AutoIt3: v3.1.1.87beta

Regards,

Buffo

add

WinSetState("System Properties","",@SW_HIDE)

right after that run line...

As to why the one run line does not hide the window - well, it did... it hid rundll32.exe

Rundll32.exe used shell32.dll to start the system control panel applet... so the AutoIt "Run" function did not start the applet and it did not hide it. - I think.

Edit1: I know that Rundll32.exe does not show a window - so there is nothing to hide... but AutoIt tried. Right?

Edit2: I think that you can change most of these settings in the registry.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

WinSetState("System Properties","",@SW_HIDE)

That's I am wondering about. For me it's impossible to hide this window. Even if I try

Run("control sysdm.cpl", "", @SW_HIDE)

the window will not be hidden. I don't understand this. Maybe a bug?

Btw: I tried it with the latest stable Autoit-Version, too.

Regards,

Buffo

Share this post


Link to post
Share on other sites

That's I am wondering about. For me it's impossible to hide this window. Even if I try

Run("control sysdm.cpl", "", @SW_HIDE)

the window will not be hidden. I don't understand this. Maybe a bug?

Btw: I tried it with the latest stable Autoit-Version, too.

Regards,

Buffo

AutoIt is hiding control.exe

Run("control") will make it show

I tested

RunWait("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1", "", @SW_HIDE)

WinSetState("System Properties","",@SW_HIDE)

and it worked for me - I had to do a

WinSetState("System Properties","",@SW_SHOW)

to get the window to show and kill it...

I rarely post untested code - but now it does not hide the window...

I do not know what to suggest next other than edit the registry directly.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I tested

RunWait("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1", "", @SW_HIDE)

WinSetState("System Properties","",@SW_HIDE)

and it worked for me - I had to do a

WinSetState("System Properties","",@SW_SHOW)

to get the window to show and kill it...

I rarely post untested code - but now it does not hide the window...

A RunWait test works at hiding the window?

This makes it hide when the window appears.

Run("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1")
WinWait("System Properties")
WinSetState("System Properties","",@SW_HIDE)

Share this post


Link to post
Share on other sites

Thx for your help :-)

My fault was to forget the line: WinWait("System Properties")

Now, it's running...

But the window will still appear for a short time. Isn't it possible to start the dialog completely hidden? It's only an aesthetic thing but for me it's important ;-)

Regards,

Buffo

Share this post


Link to post
Share on other sites

Opt('WinWaitDelay', 10) should make it hard to see the initial window.

Opt('WinWaitDelay', 10)
Run("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1")
WinWait("System Properties")
WinSetState("System Properties","",@SW_HIDE)
Opt('WinWaitDelay', 250)
1 person likes this

Share this post


Link to post
Share on other sites

Yes, that's it. Works great. Thx a lot :-)

Regards,

Buffo

Share this post


Link to post
Share on other sites

A RunWait test works at hiding the window?

It was an unintentional copy/paste of one of the many things that I tried.

The RunWait was to let me look at taskmanager.

I do not know why I did not think of the WinWait...

Ill blame it on trying to post to too many threads...

...too many threads in the head.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

No problem, just relax about it. B)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0