GLBasic forum

Main forum => GLBasic - en => Topic started by: Marmor on 2015-Jan-05

Title: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-05
Hi,

has anyone a hint to get the desktop as a image (windows) ?
Title: Re: get desktop or window a bmp in win
Post by: Ian Price on 2015-Jan-05
Do you mean via GLB (grabbing the dektop image) or from Windows itself?

You can grab the desktop from Windows by pressing "PRT SC" then pasting into an image package.
Title: Re: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-05
via glb .
Title: Re: get desktop or window a bmp in win
Post by: Schranz0r on 2015-Jan-06
a "Screenshot"?!
Title: Re: get desktop or window a bmp in win
Post by: MrTAToad on 2015-Jan-06
It cant be done in GLBasic - whilst you could use C/C++ to do it (see http://www.codeproject.com/Articles/3498/Barry-s-Screen-Capture), the problem would be converting from Windows bitmap format to GLBasic
Title: Re: get desktop or window a bmp in win
Post by: matchy on 2015-Jan-06
I wonder if the PRTSCN key be sent in GLB, otherwise I imagine it's an inline Window API dll call.


Title: Re: get desktop or window a bmp in win
Post by: MrTAToad on 2015-Jan-06
You still need to convert HBITMAP to RGB, it should be doable, but not terribly easy...
Title: Re: get desktop or window a bmp in win
Post by: Moru on 2015-Jan-06
Sounds like this would be the project where GLBasic isn't the first choice :-) What are you making?
Title: Re: get desktop or window a bmp in win
Post by: MrTAToad on 2015-Jan-06
Perhaps he wants to frighten users by doing weird things with the image :)
Title: Re: get desktop or window a bmp in win
Post by: erico on 2015-Jan-06
...or maybe to send desktop status to a remote device? ;)
Title: Re: get desktop or window a bmp in win
Post by: MrTAToad on 2015-Jan-07
As in VNC type stuff ? Would be interesting!
Title: Re: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-07
erico +1!

situation : i have isdn monitor on win32  running in the shop.  it shows the caller and the callerid in a seperate windows  for a few seconds if anyone call us.
this runs since 14 years and working fine in 99%. ( he its windows ;) )
last weeks i rebuildt the it in the shop because we are getting bigger a bit.
now not everybody can see who is calling because the server runs in a seperate room.
using a vnc server and some clients is the easy solution but will destroy my network speed.
( one server , 8 clients ) . but the speed is important for some reasons  ( big databases)
so my idea is : runing a software which checks if the isdn monitor showing the caller using findwindow with winapi. if yes grab the window , save it to hd and send it to some android tablets which stands on the desk.
so everybody can see the name and number from the caller.
this will cut the network speed  because it sends only if somebody call. ( max 250 per day incl. Fax)
and  only 3 clients are needed because the tablets can have a better place (put it on the wall) as the
used network clients.
another reason for this is this will work seperate and without running the pc clients ( power saving).
i tested some isdn monitors which sends some info over tcp to his clients ,are  not good because
it isnt working 100%  and put the popping up window on the front. this is awfull if you working on.



btw: for years i programming a vnc client in glb for a CNC from a big seller which not used the standard VNC protokoll , so you need to buy some extra software from him.
this wasnt fully working and i loose the glb source from this over the last years.

thx for reading .

@matchy

maybe i test this with some esp8266 a mini oled and a microchip or arduino also  to become
a small  info center ;) for fun .



Title: Re: get desktop or window a bmp in win
Post by: kanonet on 2015-Jan-07
Guess GLBasic is not perfectly suited for developing viruses and trojans and such nasty stuff. :nana:

I would suggest to not code this feature by yourself, but call some command line program instead, e.g. one of those:
https://code.google.com/p/screenshot-cmd/
http://www.ducklink.com/p/command-line-screen-capture/
http://www.nirsoft.net/utils/nircmd.html
Why reinvent the wheel, if there are so many powerful tools out there?
Title: Re: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-07
not reinvent the wheel , only programming my own for interest.
using glb for android to show the caller id is imho a good solution , capture the screen from the server
maybe isnt but i will test it .
and no ,its not a virus or trojan or nasty because its really usefull in this situation  :booze:

i will show the progress here ...
Title: Re: get desktop or window a bmp in win
Post by: Moru on 2015-Jan-07
Virus needs to reproduce itself.
Trojan needs to be started by tricking the user.

Don't see neither in this application. Maybe look around, there are a number of different ways to do phone switchboards now if you have good enough Internet connection. We are using some SIP thing that can show caller ID and I think it can show a picture of the caller too. We can even extract all the data from our database and add it to the phone program automatically every night. Not that we have bothered but it would be helpful to see what company is calling.

They are usually much cheaper than ISDN too :-)
Title: Re: get desktop or window a bmp in win
Post by: Schranz0r on 2015-Jan-07
You need only numbers to display?
Why capture the whole screen, any chance to get the number / save it temp. to a file and sent it over to the Client?
Title: Re: get desktop or window a bmp in win
Post by: Moru on 2015-Jan-07
He also needs the photo that shows up at the same time.
Title: Re: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-09
Ha , found an easy way to get the phone Number
and sorting the database to get the pic from
the caller.

Trying now to broadcast the data to a cheap android
Device.

Videos next days...
Title: Re: get desktop or window a bmp in win
Post by: erico on 2015-Jan-09
Nice :good:
Title: Re: get desktop or window a bmp in win
Post by: Kitty Hello on 2015-Jan-09
See the GLB file transfer library. It does all this for you.

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: get desktop or window a bmp in win
Post by: Marmor on 2015-Jan-12
this is the testvideo from the udp broadcasting.

not much Gui or images yet but it works fine !


the database file is preinstalled on the phone to becomes a better performance on the server.
the server brodcasts only  caller id  to become a better network performance as VNC.
no extra Pc or big screen needed .
only some "old" unused  Phones or Tablets.