low-level commands

Blitz3D Forums/Blitz3D Userlibs/low-level commands

Prym(Posted 2017) [#1]
Hello to the readers and animators of the forum blitzbasic.

I would like to know how, in my program,
I could detect the action of turning off the PC,
By the stop button, or with the mouse, Or any other action of the user.

How to detect the mouse click on the red cross Top right in a Windows window?

I assume you need the user32.dll or gdi32.dll library.
Hopefully this is accessible, and not too complicated.

Thanks in advance for any light.




- FR -

Bonjour aux lecteurs et animateurs du forum blitzbasic .

Je voudrais savoir comment , dans mon programme ,
je pourrais détecter l'action d'éteindre le PC ,
par le bouton d'arrêt , ou avec la souris ,
ou toute autre action de l'utilisateur .

Comment détecter le clic de la souris sur la croix rouge
en haut à droite dans une fenêtre Windows ?

Je suppose qu'il faut la librairie user32.dll ou gdi32.dll .
En espérant que ce soit accessible , et pas trop compliqué .

Merci d'avance pour toute lumière .


grable(Posted 2017) [#2]
Both of those actions use window messages, so you would need to override the windowproc of the window in question and handle them yourself.
This isnt that easy in Blitz3D without some advanced userlib capable of passing functions over though.

The easiest would be to create a DLL that handles all that, it depends on how much interactivity you want out of it i guess.


grable(Posted 2017) [#3]
I was curious about this myself, so here is my basic attempt.
Its not very smart though, since i didnt bother with callbacks or anything like that.
And i didnt test the shutdown part that much since its a right pain! But it works at least...

The archive contains compiled DLL+sources and a sample: https://drive.google.com/open?id=0BzVLNZSckvfhbG5qSi1hcnVDaUU

sample:



Dan(Posted 2017) [#4]
I guess testing the shutdown function is best done under vmware player, if you have an xp installation CD.


Prym(Posted 2017) [#5]
Thank you for your reply .
I will study the sample.

Merci pour votre réponse .
Je vais étudier le sample .


Prym(Posted February) [#6]
It works fine !
And very useful !
Thanks .


Prym(Posted February) [#7]
Je voudrais aussi savoir comment lire un fichier sur un serveur .
Faut-il une "dll" ?
Faut-il commander un serveur PHP ?
Existe-t-il une façon simple
de lire simplement une ligne de texte
dans un fichier distant , sur un serveur ?
Merci d'avance pour votre science .

I would also like to know how to read a file on a server.
Should a 'dll' ?
Should I order a PHP server ?
Is there a simple way
to simply read a
text line in a remote file, on a server ?
Thanks in advance for your science .