Jump to content

@SW_LOCK


anixon
 Share

Recommended Posts

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

Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

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