Gregory Diebold
49 discussion posts
I have created a custom function & a custom script that I would like to use together, where the script calls the function, unless there is a better option.
(see attachments)
* "Move to 2" simply uses DF built-in functionality to move the app to monitor #2.
* The goal of my script is to:
- launch the main Windows apps I use for updates.
- provide a delay for the apps to load.
- move certain apps to montor #2 while leaving my Windows Update on monitor #1.
I am using "BFS.DisplayFusion.RunFunction()" along with my "Move to 2" function. It works, but is there a more elegant way to run the app on monitor #2 in code?
I realize triggers can be set to move certain apps as I have done this; however, I have these apps triggered to run on monitor #1 currently. I only want them to run on monitor #2 within this script.
2023-12-04_11-42-30.png
•
Attachment: m2.png [27,966 bytes]
m2.png
Dec 4, 2023 (modified Dec 4, 2023)
•
#1
Gregory Diebold
49 discussion posts
Thanks for the lead!
(see attachment)
A - I made modifications to my script based on your tip, 👍. The script now works how I need it to. I find the delay parameter is a trial-&-error experience since the value needed depends on the current processor load. 500 works sometimes, but 2500 is needed as the same parm under different loads.
I moved the variable pointer declaration to the top so I could reuse it for each window launched.
B - What is the main difference between .Sleep() & .ThreadWait()? They seem to have the same effect. I looked in the Help to read up on the differences, but .Sleep() must be a new function.
C - My next challenge is to position the cursor on monitor #2 over the dashed circled camera group. An extra added bonus would be to simulate a left mouse click, if possible.
2023-12-05_06-46-11.png
Dec 4, 2023 (modified Dec 5, 2023)
•
#3
Gregory Diebold
49 discussion posts
UPDATE! I used the virtual screen coordinates of monitor #2 to position the mouse cursor and left-click. Getting the coordinates was done by using SnagIt to capture both desktops and then pasting into Gimp.
Works great!! I put the positioning code at bottom after both apps were loaded so I wouldn't need to put .Sleep() in.
Any suggestions?
•
Attachment: df.png [49,106 bytes]
df.png
Glad to see you got the mouse positioning and clicking working. I believe Sleep and ThreadWait do the same thing but it should be documented, I've added that to our to-do list.
Gregory Diebold
49 discussion posts
ThreadWait just sounds cooler, though. I added a "double-click" to maximize one of my cameras. Any suggestions on improving the code? 🖖
2023-12-05_17-11-28.png
Dec 5, 2023 (modified Dec 5, 2023)
•
#6
Nope, it looks pretty good to me!
BFS.Dialog.GetUserInputListViewWithFilter provides a multi-line list and clicking an item in it selects it.
Gregory Diebold
49 discussion posts
I'm using Windows 11, 10.0.22631 but do not see my jump list functions when right-clicking the DF icon.
2023-12-07_09-27-35.png
Gregory Diebold
49 discussion posts
Ahhh, on the 2'nd monitor only. ok, thought they both became DF Taskbars. Works fine.
df task.png