Author Topic: get desktop or window a bmp in win  (Read 4664 times)

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
get desktop or window a bmp in win
« on: 2015-Jan-05 »
Hi,

has anyone a hint to get the desktop as a image (windows) ?

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4144
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: get desktop or window a bmp in win
« Reply #1 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.
I came. I saw. I played.

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Re: get desktop or window a bmp in win
« Reply #2 on: 2015-Jan-05 »
via glb .

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5013
  • O Rly?
    • View Profile
Re: get desktop or window a bmp in win
« Reply #3 on: 2015-Jan-06 »
a "Screenshot"?!
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

  • Guest
Re: get desktop or window a bmp in win
« Reply #4 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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: get desktop or window a bmp in win
« Reply #5 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.



MrTAToad

  • Guest
Re: get desktop or window a bmp in win
« Reply #6 on: 2015-Jan-06 »
You still need to convert HBITMAP to RGB, it should be doable, but not terribly easy...

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1773
    • View Profile
    • Homepage
Re: get desktop or window a bmp in win
« Reply #7 on: 2015-Jan-06 »
Sounds like this would be the project where GLBasic isn't the first choice :-) What are you making?

MrTAToad

  • Guest
Re: get desktop or window a bmp in win
« Reply #8 on: 2015-Jan-06 »
Perhaps he wants to frighten users by doing weird things with the image :)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4178
    • View Profile
    • Portfolio
Re: get desktop or window a bmp in win
« Reply #9 on: 2015-Jan-06 »
...or maybe to send desktop status to a remote device? ;)

MrTAToad

  • Guest
Re: get desktop or window a bmp in win
« Reply #10 on: 2015-Jan-07 »
As in VNC type stuff ? Would be interesting!

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Re: get desktop or window a bmp in win
« Reply #11 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 .




Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: get desktop or window a bmp in win
« Reply #12 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?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Re: get desktop or window a bmp in win
« Reply #13 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 ...

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1773
    • View Profile
    • Homepage
Re: get desktop or window a bmp in win
« Reply #14 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 :-)