Jump to content

Winsetstate in VB


Recommended Posts

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

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

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

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

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...