Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
John Davidson
5 discussion posts
Much of my work is done in full-screen MS-Word, with laptop plus two other screens, where the slowest link in the system is the user/keyboard. Plenty of time left for DF to do its thing. There are times, however, when I run a VBA macro that searches and extracts blocks of text from a large database, according to certain settable keywords/strings. It can take 20-30 mins to run, depending on the keywords/strings selected. When this macro is running alongside DF, DF slows it down by up to 20-25%.

Is there a way to pause DF when this macro is running? i.e. can DF be paused and restarted programmatically? Thanks.
Nov 23, 2022  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hi John,

There isn't a way to pause DisplayFusion, but you can run these commands to exit & start it from a command line:

"C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -closeall

"C:\Program Files (x86)\DisplayFusion\DisplayFusion.exe"

Hope that helps!
Nov 24, 2022  • #2
User Image
John Davidson
5 discussion posts
Thanks. That looks like it'll do the trick. :)
Nov 24, 2022 (modified Nov 24, 2022)  • #3
User Image
John Davidson
5 discussion posts
Any idea what's wrong with the Call Shell statement? It is running the command, but DF is telling me "No command line parameters found", which means that it is not picking up the argument. Run directly from the command prompt the command itself works fine.

Sub runCmdLine()

Dim strProgramName As String
Dim strArgument As String

strProgramName = "C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe"
strArgument = "-closeall"

Call Shell("""" & strProgramName & """ """ & strArgument & """", vbNormalFocus) ' statement is not passing the argument correctly

' These are the command lines to be run
' "C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -closeall
' "C:\Program Files (x86)\DisplayFusion\DisplayFusion.exe"

End Sub
Nov 25, 2022  • #4
User Image
John Davidson
5 discussion posts
Ah! A friend pointed out that the argument should not be in inverted commas. This code is now working:

Code

Sub runDFCmdLine()
    ' Run these command lines
    ' "C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -closeall
    ' "C:\Program Files (x86)\DisplayFusion\DisplayFusion.exe"

    Dim strProgramName As String
    Dim strArgument As String

    strProgramName = "C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe"
    strArgument = "-closeall"
    Call Shell("""" & strProgramName & """ " & strArgument, vbNormalFocus)
    MsgBox "DisplayFusion has been exited"
    
    ' Perform task without DF running
    
    strProgramName = "C:\Program Files (x86)\DisplayFusion\DisplayFusion.exe"
    Call Shell("""" & strProgramName & """", vbNormalFocus)
    MsgBox "DisplayFusion has been restarted"
End Sub


Thanks for the help.
Nov 25, 2022  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)