Sign in to follow this  
Followers 0
whiteeey32

Winsetstate in VB

9 posts in this topic

I try to minimize a window in vb but just can't seem to get it any ideas?

CODE
strwindowtitle = "Privoxy"

intResult = cAutoit.WinExists(strwindowtitle, strwindowtext)

If intResult = 0 Then

cAutoit.Run "C:\Program Files\Vidalia Bundle\Privoxy\privoxy.exe"

cAutoit.Sleep 300

cAutoit.WinSetState strwindowtitle, "", SW_MINIMIZE

Else

cAutoit.WinSetState strwindowtitle, "", minimize

End If

Share this post


Link to post
Share on other sites



I try to minimize a window in vb but just can't seem to get it any ideas?

strwindowtitle = "Privoxy"
intResult = cAutoit.WinExists(strwindowtitle, strwindowtext)
If intResult = 0 Then
      cAutoit.Run "C:\Program Files\Vidalia Bundle\Privoxy\privoxy.exe"
      cAutoit.Sleep 300
      cAutoit.WinSetState strwindowtitle, "", SW_MINIMIZE
Else
      cAutoit.WinSetState strwindowtitle, "", minimize
End If
Try using a cAutoit reference for the state values (as in the help file example):
strwindowtitle = "Privoxy"
intResult = cAutoit.WinExists(strwindowtitle, strwindowtext)
If intResult = 0 Then
      cAutoit.Run "C:\Program Files\Vidalia Bundle\Privoxy\privoxy.exe"
      cAutoit.Sleep 300
      cAutoit.WinSetState strwindowtitle, "", cAutoit.SW_MINIMIZE
Else
      cAutoit.WinSetState strwindowtitle, "", cAutoit.minimize
End If

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Try using a cAutoit reference for the state values (as in the help file example):

strwindowtitle = "Privoxy"
intResult = cAutoit.WinExists(strwindowtitle, strwindowtext)
If intResult = 0 Then
      cAutoit.Run "C:\Program Files\Vidalia Bundle\Privoxy\privoxy.exe"
      cAutoit.Sleep 300
      cAutoit.WinSetState strwindowtitle, "", cAutoit.SW_MINIMIZE
Else
      cAutoit.WinSetState strwindowtitle, "", cAutoit.minimize
End If

:)

Works somewhat, it minimized the program into a smaller title bar in the lower left, the program itself will minimize to the system tray when closed or minimized thats what i would like it to do, is that a way to have it run in a minimized state?

Share this post


Link to post
Share on other sites

Works somewhat, it minimized the program into a smaller title bar in the lower left, the program itself will minimize to the system tray when closed or minimized thats what i would like it to do, is that a way to have it run in a minimized state?

Hi,

If the program minimize on tray imself when closed have you tried alt+f4 or winclose ?

WinActivate("window","")
WinWaitActive("Window","",5)
Send("{ALT}+{F4}")

Winclose("Window","")

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hi,

If the program minimize on tray imself when closed have you tried alt+f4 or winclose ?

WinActivate("window","")
WinWaitActive("Window","",5)
Send("{ALT}+{F4}")

Winclose("Window","")
He's not using regular AutoIt. This about running it through AutoItX COM/Active-X control.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

He's not using regular AutoIt. This about running it through AutoItX COM/Active-X control.

:)

Your right, I'm scripting with VB so some of the commands are a little different than just auoit script

Share this post


Link to post
Share on other sites

Your right, I'm scripting with VB so some of the commands are a little different than just auoit script

If it's for another language than autoit, why come you here for ask it ?

Strange or I'm stupid like always :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

If it's for another language than autoit, why come you here for ask it ?

Strange or I'm stupid like always :)

AutoItX is included with AutoIt. Look in your start menu at: Start/All Programs/AutoIt v3/Extras/AutoItX

It's purpose to allow using AutoIt functions from other languages, like VB.

There is a specific support forum for it (which is perhaps where this topic should be): ActiveX/COM Help and Support (AutoItX)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

AutoItX is included with AutoIt. Look in your start menu at: Start/All Programs/AutoIt v3/Extras/AutoItX

It's purpose to allow using AutoIt functions from other languages, like VB.

There is a specific support forum for it (which is perhaps where this topic should be): ActiveX/COM Help and Support (AutoItX)

:)

Thats i was saying, im stupid sorry :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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