I want to make a lock screen like the one Windows does when u log off.
A full screen which u cannot minimize or close or switch to other applications. just normal lock screen.
any API's, ideas or any guides?
I want to make a lock screen like the one Windows does when u log off.
A full screen which u cannot minimize or close or switch to other applications. just normal lock screen.
any API's, ideas or any guides?
This is going to be completely different depending on the targetted OS and your requirements. Do you want to block ALT+F4? How about ALT+TAB or WindowsKey+TAB (Vista and above), or WindowsKey+D, etc?
Maybe immitating a screen saver would be the way to go, as in SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);
I've no idea about Linux or Mac though.
thanks for replying
1- my target is Windows
2- yes I want to disable all the keys you mentioned
3- I will try ur advice and give u feedback
I didn't get any luck about immitating screen saver
any help ? I want to implement a custom full screen widget that locks the screen
Last edited by ahmdsd_ostora; 9th July 2010 at 17:58.
Which is what a screen saver does.
Which part of you struggling with?
SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);
I don't understand where to find this !!
no info in the docs
It's an OS specific function, as stated.
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
thanks alot for help,
I tried to set the parameter as u told me but the method returns false:
Qt Code:
bool prevState=0; bool result; result=SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &prevState, 0);To copy to clipboard, switch view to plain text mode
but i get result = false
I am working on Windows 7
Did you call GetLastError to find out why? http://msdn.microsoft.com/en-us/libr...60(VS.85).aspx
thanks again, I think it's a compatibility issue, so I decided to change the strategy.
now I have a screen that I disabled close events for it, set it to full screen, working well.
the only problem now is to disable the (alt + tab ) combination or any key combination that lets the OS raise another application on the top.
can I do that using event catching?
No, as it's another system function.
Its doubtful it's a compatibility issue, more likely to be that your application has insufficient priviledges to execute the stated command on Windows 7. You would probably have to request administrative priviledges (or at least, elevated priviledges) in your applications manifest.
You could try grabbing the keyboard and mouse, I don't know if that overrides the system hotkeys but you can try it. But still your application could be closed/deactivated by another software. It would be good if you said why you need this functionality.
Bookmarks