Quick test please Topic is solved
Quick test please
Hi guys.
Getting back and trying to pick back up on learning AHK for a little project I have in mind.
But before I start to get caught up on AHK, I need to know a little something.
Once my script is built and running, I will need to carry my laptop with me at all times, 24/7 with internet access.
So the script will also need to be running all the time, always doing an image search on screen all the time.
And because I will need to carry it with me all the time, I opted for a Microsoft Surface Go laptop. It's the lightest and smallest laptop I could find, for portability. I will also carry a battery bank with it as the Go internal battery doesn't last all day by itself.
The problem is that when I close the lid/keyboard, the screen goes automatically to the log in screen. I would like the screen to stay on the desktop, and have the script running with the lid/keyboard closed.
So can the script keep working and doing image searches on the desktop while the screen is on the log in page? How can I test if this can work before I get started with my project?
I looked to change the settings so that the screen would remain on the desktop with the lid closed. So far I have not been able to do that.
Getting back and trying to pick back up on learning AHK for a little project I have in mind.
But before I start to get caught up on AHK, I need to know a little something.
Once my script is built and running, I will need to carry my laptop with me at all times, 24/7 with internet access.
So the script will also need to be running all the time, always doing an image search on screen all the time.
And because I will need to carry it with me all the time, I opted for a Microsoft Surface Go laptop. It's the lightest and smallest laptop I could find, for portability. I will also carry a battery bank with it as the Go internal battery doesn't last all day by itself.
The problem is that when I close the lid/keyboard, the screen goes automatically to the log in screen. I would like the screen to stay on the desktop, and have the script running with the lid/keyboard closed.
So can the script keep working and doing image searches on the desktop while the screen is on the log in page? How can I test if this can work before I get started with my project?
I looked to change the settings so that the screen would remain on the desktop with the lid closed. So far I have not been able to do that.
Re: Quick test please
I don't believe so, but you could check the lid settings and adjust them.
Code: Select all
Run, control /name Microsoft.PowerOptions /page pageGlobalSettings
Re: Quick test please
You can try to remove the sensor that detects that the lid is closed.
Re: Quick test please
I haven't worked with windows in a while. Here is the result I got when running your suggested command in the command prompt:mikeyww wrote: ↑04 Dec 2021, 15:17I don't believe so, but you could check the lid settings and adjust them.
Code: Select all
Run, control /name Microsoft.PowerOptions /page pageGlobalSettings
Code: Select all
C:\Users\GO>Run, control /name Microsoft.PowerOptions /page pageGlobalSettings
'Run' is not recognized as an internal or external command,
operable program or batch file.
Re: Quick test please
I found a settings page that allows me to change the computer behavior when I close the lid. I changed the "When I close the lid" setting from "Sleep" to "Do nothing" for both plugged in an on battery options. The result is that the screen no longer turns off when I close the lid, which is partly what I want. But the display still goes to Log in page.
Can a script work and look for an image on the desktop while the screen is on Log in page?
Can a script work and look for an image on the desktop while the screen is on Log in page?
Re: Quick test please
That is hardly possible, because the image is not displayed on the desktop when the login page is shown.
But you can try if it works when you run the script on a virtual machine. A virtual machines desktop may be reachable even if the whole window of the virtual machine is minimized or hidden.
But you can try if it works when you run the script on a virtual machine. A virtual machines desktop may be reachable even if the whole window of the virtual machine is minimized or hidden.
Re: Quick test please
This is a code that need to be run with autohotkey,not command promptPepeLapiu wrote: ↑04 Dec 2021, 15:36I haven't worked with windows in a while. Here is the result I got when running your suggested command in the command prompt:mikeyww wrote: ↑04 Dec 2021, 15:17I don't believe so, but you could check the lid settings and adjust them.
Code: Select all
Run, control /name Microsoft.PowerOptions /page pageGlobalSettings
Code: Select all
C:\Users\GO>Run, control /name Microsoft.PowerOptions /page pageGlobalSettings 'Run' is not recognized as an internal or external command, operable program or batch file.
In Cmd,you just need
control /name Microsoft.PowerOptions /page pageGlobalSettings
This will lead you to the settings(you can also type Lid in the start menu)where you choose what to happen when you close the lid
And you cannot run ahk that scan the screen for something specific while you are on the lock screen
AHK is literally looking at what you currently see and if that is the lock screen,it will not do what you want(it's like taking a screenshots and looking at specific area for pixels of specific color)
I never tried if PixelSearch can work when the screen is just off
This cmd command can turn off your screen without going to the lock screen
Code: Select all
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)
Or with Autohotkey
Code: Select all
Loop
{
Sleep,1000
If SubStr(A_TimeIdleMouse,1,-3) < 5
{
MsgBox,4,Screen Off,Turn off the screen?,10
IfMsgBox,Yes
{
SendMessage,0x112,0xF170,2,,Program Manager
Sleep,5000
}
IfMsgBox,TIMEOUT
{
SendMessage,0x112,0xF170,2,,Program Manager
Sleep,5000
}
IfMsgBox,No
Break
}
}
ExitApp
Yes will turn if off
No will exit the script
No answer for 10 seconds will turn off the screen
Re: Quick test please
This is purely theoretical and I haven't tested it, but this MIGHT work. If you are the only user on the laptop and you change your password to nothing (blank, empty i.e. no password) and then disable Windows 10 lockscreen with instructions here:
https://www.howtogeek.com/270493/how-to-disable-the-lock-screen-in-windows-10/
in addition to the power settings you have already tried.
In theory, if there is no lock screen, and no password to require a login, your desktop should remain visible.
Of course, this takes ANY security away from your laptop. The risk is yours.
Russ
https://www.howtogeek.com/270493/how-to-disable-the-lock-screen-in-windows-10/
in addition to the power settings you have already tried.
In theory, if there is no lock screen, and no password to require a login, your desktop should remain visible.
Of course, this takes ANY security away from your laptop. The risk is yours.
Russ
Re: Quick test please
Instead of making image searches, you can also save the full screen contents to the clipboard and analyze the text that is saved (send ^a^c). That should work regardless of the screen display being on.
If you don't find there the information you need, you can also save the page to a file (send ^s) and then read the file and try to analyze the html text.
If you don't find there the information you need, you can also save the page to a file (send ^s) and then read the file and try to analyze the html text.
Re: Quick test please
https://answers.microsoft.com/en-us/windows/forum/all/screen-locks-when-i-close-the-lid-on-my-laptop/c33bc6ee-a89c-487e-948d-7192b3555f63
Take a look at the 2nd image in the answer. (sign-in options)
Take a look at the 2nd image in the answer. (sign-in options)
Re: Quick test please
Thank you all for your help. I'm going to try your suggestions as soon as I get home.
Now, I wish I would have seen your replies earlier. I don't know why I was not notified.
If your tricks don't solve the problem, I'll see if I can write a script that would log in as soon as the log in screen comes up. But I'm not sure if the screen keeps going back to the log in if it detects the lid is closed.
If all else fails, I'll just carry the screen and keyboard/lid seperately.
Again, thank you all very much for your generous help.
Now, I wish I would have seen your replies earlier. I don't know why I was not notified.
If your tricks don't solve the problem, I'll see if I can write a script that would log in as soon as the log in screen comes up. But I'm not sure if the screen keeps going back to the log in if it detects the lid is closed.
If all else fails, I'll just carry the screen and keyboard/lid seperately.
Again, thank you all very much for your generous help.
Re: Quick test please
Thank you! It worked perfectly, easily, and exactly as needed. This takes a big burden off of my shoulders.RussF wrote: ↑05 Dec 2021, 16:21This is purely theoretical and I haven't tested it, but this MIGHT work. If you are the only user on the laptop and you change your password to nothing (blank, empty i.e. no password) and then disable Windows 10 lockscreen with instructions here:
https://www.howtogeek.com/270493/how-to-disable-the-lock-screen-in-windows-10/
in addition to the power settings you have already tried.
In theory, if there is no lock screen, and no password to require a login, your desktop should remain visible.
Of course, this takes ANY security away from your laptop. The risk is yours.
Russ
I was going to build a little wooden sleeve to carry in my backpack with two slots in it to store the screen and keyboard separately. But your trick solved the problem!
Re: Quick test please Topic is solved
I'm glad it worked! Quite honestly, I wasn't sure if it would. Now, just don't let that device out of your sight.
Russ
Russ
Re: Quick test please
Just a little update for posterity's sake. It no longer works. Well, it works for a while than for some reason the desktop goes to the log in screen.
So I set everything to do nothing. When I close the lid, do nothing, when I am away for too long, do nothing, and so on... And I got rid of the password. All that did is prevent tmremove the password from the log in screen, but it didn't remove the log in.
RussF's trick worked for a while, but when I get up in the morning, it's back on the log in page. I just have to restart the computer to remove the log in screen. That seems to work but only until the next morning.
The keyboard/cover is Bluetooth and it goes to sleep after a while. It's possible it reverts to the log in screen once the cover goes to sleep.
I'll have to see if the setting sticks with the keyboard removed or turned off completely. Or I'll just get a script that keeps login back in every time the log in screen comes on.
That script would also turn the screen back on if it turns off, and beep at me to let me know if internet is lost.
Or maybe a script that moves the mouse around a little every few minutes to keep the puter awake. Or to restart the puter every few hour or so. I'll have to see what works.
Re: Quick test please
Well, I did stipulate that my idea was pure theoretical.
I have PCs (Windows 10 Pro) set up in our manufacturing facility with no keyboard or mouse attached - they are managed purely by remote access. We use them as status boards that track and display jobs as they pass through our shop. There are two users on each - an admin account and a standard account. The standard account has no password. All display and sleep options are turned off. If the device is restarted either manually or due to power loss or Windows update, they always default to the last user to have signed in. Since it is always the standard user and there is no password for it, the PC just boots right to the desktop and auto-runs the job monitoring system. If I need to do something via the admin account, I have to log off the standard user, select admin, enter password and sign in. If I restart at that point, the login screen is presented and I have to choose the standard user again. From that point forward, it always defaults to the standard user again and you never see the login screen.
If you only have the one user, there is no choice to be made, and Windows SHOULD just go to the desktop of your user.
Did your device go to the login screen while it was open or closed?
Since it is a Micro$oft product, the hardware could be more tightly meshed with the OS and it could be part of their goal to take all control of our devices away from us - because, well, THEY know what we need and want better than WE do!
It's possible that you may have to go back to your plan of keeping the keyboard detached and using it in tablet mode. If you are carrying it around, you will probably have to fashion some sort of protective sleeve to prevent unwanted touches to the screen (just make sure to give it plenty of ventilation.)
Best of luck!
Russ
I have PCs (Windows 10 Pro) set up in our manufacturing facility with no keyboard or mouse attached - they are managed purely by remote access. We use them as status boards that track and display jobs as they pass through our shop. There are two users on each - an admin account and a standard account. The standard account has no password. All display and sleep options are turned off. If the device is restarted either manually or due to power loss or Windows update, they always default to the last user to have signed in. Since it is always the standard user and there is no password for it, the PC just boots right to the desktop and auto-runs the job monitoring system. If I need to do something via the admin account, I have to log off the standard user, select admin, enter password and sign in. If I restart at that point, the login screen is presented and I have to choose the standard user again. From that point forward, it always defaults to the standard user again and you never see the login screen.
If you only have the one user, there is no choice to be made, and Windows SHOULD just go to the desktop of your user.
Did your device go to the login screen while it was open or closed?
Since it is a Micro$oft product, the hardware could be more tightly meshed with the OS and it could be part of their goal to take all control of our devices away from us - because, well, THEY know what we need and want better than WE do!
It's possible that you may have to go back to your plan of keeping the keyboard detached and using it in tablet mode. If you are carrying it around, you will probably have to fashion some sort of protective sleeve to prevent unwanted touches to the screen (just make sure to give it plenty of ventilation.)
Best of luck!
Russ
Re: Quick test please
I close the lid, put it away with charger on, and when I open it later on (in the morning) the log in screen is on.
I'm just going to build a little sleeve out of wood with two compartments. For the keyboard and tablet to be stored separately. I figure the sleeve will help provide more shielding against damage anyways. It will be carried with me 24/7 in a backpack.
Re: Quick test please
Problem solved!
And all by accident too. The battery on my Bluetooth keyboard just died, so th e keyboard was turned off. And when turned off, it doesn't trigger anything when closed. So I just have to turn off the keyboard before closing it is all.
And all by accident too. The battery on my Bluetooth keyboard just died, so th e keyboard was turned off. And when turned off, it doesn't trigger anything when closed. So I just have to turn off the keyboard before closing it is all.