Active Window 11 Pro

0 views
Skip to first unread message

Agnella Datson

unread,
Aug 3, 2024, 4:59:55 PM8/3/24
to helpecalso

I'm trying to write a script that will take the focus away from the window that has the focus, and for that, I need to be able to detect the handle or title of the window that has the focus. Can you please put me out of my mysery? :-)

Hello. This is my first post. I'm using LV2014 and am developing a container to load with our current application to provide training material to users. I have a while loop that checks a training record to see if the user has viewed the material for the current active screen and prompts them if not. It works, but when I load it in the application, it can't see its own windows. I found the attached vi in a forum somewhere, but don't recall where. It gets the current active window just as long as the window is not part of the application that is running the vi. If I run two instances of the application, each one can get the active window for the other one.

Interesting, I have some very similar code that I use to see if the current VI is active or not, and it works in an executable. It runs the call library function nodes not in the UI thread, you can give it a try.

I know this is an old thread, but I came across it during a search. Be warned this VI will eventually cause LabVIEW to crash. The reason is it is allocating an empty string to the GetWindowTextA DLL call. The DLL will write to the string (which has been allocated zero bytes of data) and corrupt the memory that follows it!

Hi Christopher, thank you for the suggestion. I have used the code as-is for a couple of years and never had any problems. The documentation says "If the string is as long or longer than the buffer, the string is truncated and terminated with a null character." I have never seen the string terminated either.

Yes. I was using the VI above in a Event Handler Timeout for a popup window that I wanted to keep on top. When I clicked on the window behind the window I was interested it came back to the top, but executable then crashed. Same happened when running under LabVIEW.

You might be lucky if the window title is short. I have seen it before with other DLL's that have pointers to strings which have not been pre-allocted. LabVIEW won't do it for you. The DLL will write over you stack, corrupting whatever followed the string location.

I have tried the "Windows Blur Effects" add on (see How to change color of the active/inactive window?) but it makes gnome very slow under its default settings and I'm unable to open the settings from the "Extensions" tab in gnome-tweak-tools to make it less heavy.

It's not excellent for all applications and windows but for me (gnome 3.38.2) it's enough to quickly distinguish active window. Even if some application's window do not color headerbar correctly, an accented border is visible.

Sometimes it is good to adjust an application's preferences to better highlight it. E.g. Firefox has titlebar disabled by default and without enabling it tab bar and address bar are always colored with accented color. I enabled titlebar and shrink titlebars according to this. In applications having themes it's usually better to set default/system theme.

After installing Mavericks, my active window won't remain active. Whether typing in an active window or not, within 10 seconds the active window become inactive and I have to mouse click to activate and within 10 seconds it will deactivate again, constantly.

Just spent my entire day w/ the same problem, but I have it fixed now. I just want to "Pay it Forward". Finding a fix for this is like a needle in a haystack,, but through my 7 hrs of research,, only ONE thread out of Very Many gave me an idea of what to check.

-Turns out, there was an application in the background that kept Crashing every 10-15 sec. Every time it either crashed or tried to start again, it took the computers attention away from my current window and on to IT. The Post I read said that in their case, it was an Auto Backup program of some type.

Unfortunately, I don't have a solution, but wanted to mention that I am having the same exact issue. It is quite annoying as I can't even finish typing this sentence without having to use the mouse to make this window active. It is affecting every window this morning (safari, mail, chrome). This issue started after my Mavericks install.

After spending about 7 hours with 4 different Apple tech support personnel, including having the issue escalated to senior level technicians, my problem would occasionally stop occurring, but soon re-occur !! Very, very frustrating.

I finally brought my iMac to a Genius, and he was able to drill down to the problem that was affecting my Mac. I don't know if this will be the same "right" fix for others, but it has definitely and finally fixed my problem. I cannot explain this, because I don't understand the technical explanation I was provided, but he found there was something that was downloaded from a 3rd party application that conflicted with Mavericks. He prepared the following explanation for me to share on this forum, hoping it will help others find/fix their similar problem:

Thanks for posting the update because despite my prevoius post about an SMC reset resolving the issue, the problem arose again the next day. After a few more calls to Apple Support they have also chosen to send me to the Genius bar suspecting a hardware issue (which I doubt). I have an appointment tomorrrow morning. Reading what your Genius rep described, I too see "OnlineBackupd" in console crashing now and then. I'll show what you posted to the Genius bar tomorrow. May I ask what online backup software you use to see if I have the same one conflicting with my Maverick's installation? I use Carbon Copy Cloner and also Cox Online Secure Backup. Thanks again for posting the follow-up.

I was also told it was likely a hardware issue, but it was NOT. Like your experience, earlier efforts seemed to temporarily fix the problem, but it came back. This time, with the "fix" from the Genius, it has not reoccurred and it has been working fine for several days.

I believe, at one time, I did attempt to use an online backup system that was being offered free by my local ISP (Charter Communications) which is probably using the same s/w as your Cox Online Secure Backup service !!

Hope this helps. And, be sure to bring the specific instructions I posted for your Genius to review. His process steps should help the Genius get to the offending software/app and eliminate it. Good luck. IT sure worked for me!

George and Cincy, thanks again. After visiting the Genius bar, they confirmed that the backup daemon (onlinebackupd) was running in the background, crashing, and stealing focus away from the active window to itself making the active window not active. I uninstalled the Cox Online Secure Backup software and it has eliminated the issue so far. I'll have to watch to see if it lasts permanently. If so, I am guessing that Charter and Cox might use the same 3rd party software provider for their cloud backup service. I actually have a phone number for that 3rd party provider and might call them up directly to ask about this. Hopefully they will provide an update that is compatible with Mavericks. In the meantime, I'll have to go back to using Time Machine for regular backups.

Thanks so much for sharing your experience. I had the same problem since I installed Mavericks on my MacBook Pro, and it was driving me crazy. I followed your instructions, deleted the two files, and the problem is gone, hopefully for good. Thank you, thank you!

I used CONSOLE and found that "com.microsoft.SyncServicesAgent" was crashing and restarting every 9 seconds. This is one of the compenents of Microsoft Office 2011. I uninstall Office and rebooted. No more flashing.

George and Cindy. Thank You!!! This problem has been driving me crazy ever since I upgraded to Mavericks. After reading your post, I realized that I had an old version of Charter's on-line backup software installed (it never worked, so I forgot about it). I opened the software, clicked "uninstall," and the constant active-screen-deactivation problem stopped immediately. Lifesaver!!!

in Preview if I am annotating/editing several images and I go to "undo" things I've done to one image, I will see it instead "undoing" what I did to the other image. There was one time it "undid" something that I didn't do to either image (it rotated the image when it had been only cropped, not rotated). That caused my entire computer to lock up and give me the spinning rainbow wheel, I ended up many minutes later having to do a hard shutdown via the power button in order to get out of it.

I also have had it do this in GIMP which i only use sparingly. When I open a save or export dialog window, certain keys will apply to the main window behind the dialog window and certain of them will apply to the dialog window. So this prohibits me from entering the filename that I want, many times.

Sometimes when surfing (or switching windows) my cursor disappears and won't appear over the active window. I end up having to go to my hot corner that shows me the desktop and moves all the windows out of the way, clicking on the desktop, and then going to the same hot corner to pull the windows back and then going to the window that I wanted.

I had the same problem. I could hear the disk working, so I ran Activity Monitor. The apps launchd, kernel_task, and mds_stores were writing to the disk; and mdworker, mds, and kernel_task were reading from the disk. When these apps run they do not have windows, so it looks like the active window just deactivates with no other windows in the background. The problem would go away in about 20 minutes. As best as I can tell, these apps were optimizing files after logging in or waking from sleep. I stopped logging in/out and going to sleep, and the problem has not recurred.

UiPath.Core.Activities.GetActiveWindow Retrieves the current active Window and enables you to perform multiple actions within it. Properties Output ApplicationWindow - The found active window. This field supports only Window variables. Common...

c80f0f1006
Reply all
Reply to author
Forward
0 new messages