Jump to content

Recommended Posts

Posted

I not sure that this can be achieved but is it possible to freeze an applications window then close and reopen the application to minimise an close and open screen flicker so as not to give the appearance that the application has been closed and reopened.

This code does not work as 'ProcessClose' ignores that the Windows screen is locked using @SW_LOCK

WinSetState("Untitled -", "", @SW_Lock)
ProcessClose("Notepad.exe")
Sleep(1000)
run("notepad.exe")
WinSetState("Untitled -", "", @SW_Lock)

Help is always appreciated Ant...

Posted

I not sure that this can be achieved but is it possible to freeze an applications window then close and reopen the application to minimise an close and open screen flicker so as not to give the appearance that the application has been closed and reopened.

This code does not work as 'ProcessClose' ignores that the Windows screen is locked using @SW_LOCK

WinSetState("Untitled -", "", @SW_Lock)
ProcessClose("Notepad.exe")
Sleep(1000)
run("notepad.exe")
WinSetState("Untitled -", "", @SW_Lock)

Help is always appreciated Ant...

Maybe you could do something like this

#include <SCreencapture.au3>
#include <windowsconstants.au3>
Run("notepad.exe")
WinWaitActive("Untitled")
Send("a line of text")
Sleep(3000)


$gp = WinGetPos("Untitled")
_ScreenCapture_CaptureWnd("tempCover.bmp", WinGetHandle("Untitled"))
$hidew = GUICreate("", $gp[2], $gp[3], $gp[0], $gp[1], $WS_POPUP)
$coverpic = GUICtrlCreatePic("tempCover.bmp", 0, 0, $gp[2], $gp[3])
GUISetState()

;WinSetOnTop($hidew, "", 1)
ProcessClose("notepad.exe")
MsgBox(262144, "Notepad", "no longer exists!")

Run("notepad.exe")
WinWaitActive("Untitled")
Send("a different line of text")
GUIDelete($gp)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

Maybe you could do something like this

#include <SCreencapture.au3>
#include <windowsconstants.au3>
Run("notepad.exe")
WinWaitActive("Untitled")
Send("a line of text")
Sleep(3000)


$gp = WinGetPos("Untitled")
_ScreenCapture_CaptureWnd("tempCover.bmp", WinGetHandle("Untitled"))
$hidew = GUICreate("", $gp[2], $gp[3], $gp[0], $gp[1], $WS_POPUP)
$coverpic = GUICtrlCreatePic("tempCover.bmp", 0, 0, $gp[2], $gp[3])
GUISetState()

;WinSetOnTop($hidew, "", 1)
ProcessClose("notepad.exe")
MsgBox(262144, "Notepad", "no longer exists!")

Run("notepad.exe")
WinWaitActive("Untitled")
Send("a different line of text")
GUIDelete($gp)

Verry clever using a mask an excellent piece of code, I have done a few modifications but essentially it is the same so you can claim full credit. I was playing with SplashImageOn but that is not nearly as efficient as your GUI masking strategy given that SplashImageOn requires a timed sleep statement to ensure that the image is on screen whilst the other things happen in background.

Opt("WinTitleMatchMode", 2)
#include <SCreencapture.au3>
#include <windowsconstants.au3>
ShellExecute("Outlook.exe", "", "", "", @SW_SHOWDEFAULT)
WinWaitActive("Inbox - Microsoft Outlook", "", 20)
$WinSize = WinGetPos("- Microsoft Outlook")
_ScreenCapture_CaptureWnd(@ScriptDir & "\ScreenImage.bmp", WinGetHandle("Inbox - Microsoft Outlook"))
$hidew = GUICreate("", $WinSize[2], $WinSize[3], $WinSize[0], $WinSize[1], $WS_POPUP)
$coverpic = GUICtrlCreatePic(@ScriptDir & "\ScreenImage.bmp", 0, 0, $WinSize[2], $WinSize[3])
GUISetState()
ProcessClose("Outlook.exe")
ShellExecute("Outlook.exe", "", "", "", @SW_SHOWDEFAULT)
WinWaitActive("Inbox - Microsoft Outlook", "", 20)
GUIDelete($WinSize)

Well done and thank you again Ant..

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
×
×
  • Create New...