Jump to content

Window Want Activate!


jfcby
 Share

Recommended Posts

Hi,

In the following script the DWG TrueView Window will not Activate. I've tried the code: WinActivate("DWG TrueView", "") by itself and it activates the window.

How can I get DWG TrueView to Activate in the following code:

#include <GUIConstantsEx.au3>
#Include <WinAPI.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
$mainwindow = GUICreate("DWG TrueView Print", 250, 100, 675, 50)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit");"CLOSEClicked")
GUICtrlCreateLabel("Print DWG TrueView Active window.", 30, 10)
$printbutton = GUICtrlCreateButton("Print", 90, 50, 75, 25)
GUICtrlSetOnEvent($printbutton, "PrintButton")
GUISetState(@SW_SHOW)

  
While 1
  Sleep(1000) ; Idle around
WEnd

Func PrintButton()  
    WinActivate("DWG TrueView", "") 
EndFunc

Func _Quit();CLOSEClicked()
 ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, 
 ;and @GUI_WINHANDLE would equal $mainwindow 
  MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
  Exit
EndFunc

Thanks for your help,

jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Link to comment
Share on other sites

Hi,

In the following script the DWG TrueView Window will not Activate. I've tried the code: WinActivate("DWG TrueView", "") by itself and it activates the window.

How can I get DWG TrueView to Activate in the following code:

#include <GUIConstantsEx.au3>
#Include <WinAPI.au3>

Opt("GUIOnEventMode", 1); Change to OnEvent mode
$mainwindow = GUICreate("DWG TrueView Print", 250, 100, 675, 50)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit");"CLOSEClicked")
GUICtrlCreateLabel("Print DWG TrueView Active window.", 30, 10)
$printbutton = GUICtrlCreateButton("Print", 90, 50, 75, 25)
GUICtrlSetOnEvent($printbutton, "PrintButton")
GUISetState(@SW_SHOW)

  
While 1
  Sleep(1000); Idle around
WEnd

Func PrintButton()  
    WinActivate("DWG TrueView", "") 
EndFunc

Func _Quit();CLOSEClicked()
;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, 
;and @GUI_WINHANDLE would equal $mainwindow 
  MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
  Exit
EndFunc

Thanks for your help,

jfcby

Problem Sloved with the following code: WinActivate("DWG TrueView", "z:\")

Thanks for your help,

jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

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