Jump to content

Run with @SW_HIDE doesn't hide window


Buffo
 Share

Recommended Posts

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]

Link to comment
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

Link to comment
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]

Link to comment
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)
Link to comment
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

Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...