get desktop or window a bmp in win

Previous topic - Next topic

Marmor

Hi,

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

Ian Price

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.

Marmor


Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

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

matchy

I wonder if the PRTSCN key be sent in GLB, otherwise I imagine it's an inline Window API dll call.



MrTAToad

You still need to convert HBITMAP to RGB, it should be doable, but not terribly easy...

Moru

Sounds like this would be the project where GLBasic isn't the first choice :-) What are you making?

MrTAToad

Perhaps he wants to frighten users by doing weird things with the image :)

erico

...or maybe to send desktop status to a remote device? ;)

MrTAToad

As in VNC type stuff ? Would be interesting!

Marmor

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 .




kanonet

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

Marmor

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 ...

Moru

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 :-)