desktop

Blitz3D Forums/Blitz3D Programming/desktop

splinux(Posted 2005) [#1]
In wich way i can find the resolution of the desktop?
I think using windows api but i don't know how.

Another thing: there is a method to don't allow the user to end the program?


jfk EO-11110(Posted 2005) [#2]
You need a file named "user32.decls" inside your "userlibs" folder. It must contain the following lines:

.lib "user32.dll"
GetSystemMetrics% (nIndex%) : "GetSystemMetrics"

restart Blitz and use the following commands:

desk_w=getsystemmetrics(0)
desk_h=getsystemmetrics(1)


splinux(Posted 2005) [#3]
Thanks,
but for the second task: how to don't allow the user to terminate the program?


Rob Farley(Posted 2005) [#4]
Strap his/hers arms and legs down so they can't reach the keyboard and/or power switch and/or reset switch.


splinux(Posted 2005) [#5]
If you post the topic with no help intention, plese edit it and delete it: this is a serious forum.


King Dave(Posted 2005) [#6]
Theres a way of detecting a click on the window's X button and handling it yourself (search for blitzclose - its a userlib)
But you'll never be able to stop them 100%, end process will always kill it.


jfk EO-11110(Posted 2005) [#7]
hehe. HE still has some points left.

There is a solution in the code archives, it will bend the close button to allow some function cals after clicking it, but you can use it to disable it completely. There's also a userlib or so that removes the close button.


splinux(Posted 2005) [#8]
There isn't a possible to set special power to the program so task menager will think that is a system process?
There are, for example, viruses that the user can't delete.


Rob Farley(Posted 2005) [#9]
There is no way of stopping someone terminating a program hence my comment, they can always switch the computer off, hit the reset button or press ctrl-alt-del. Therefore it was a perfectly valid answer. If you are asking how trap the close event that is an entirely different matter.

Incedentally there are other system metrics that will return the size of the desktop minus the toolbar which tend to be more useful.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemmetrics.asp

16 for the x and 17 for the Y

You can make programs a service if you're on win2000 upwards. Not sure how to do that off the top of my head. Google is your friend on that one.


splinux(Posted 2005) [#10]
If i'll make my program a windows service, will the user couldn't close it?


Rob Farley(Posted 2005) [#11]
You can still stop a service by going into the service manager.


splinux(Posted 2005) [#12]
In wich way can i make a program a windows service?
Doeas it will works into the others win versions(98, me, nt2000,xp)?


Rob Farley(Posted 2005) [#13]
You can make programs a service if you're on win2000 upwards



slenkar(Posted 2005) [#14]
what reason would you want to do this if the program isnt malicious?


splinux(Posted 2005) [#15]
I'm making a program to improve windows, but if the user will close it, he/she will not control windows.


Lane(Posted 2005) [#16]
Perhaps you should develope it for X, and then port it to Windows.