Kiosk System
kiosk desktop capture
Hi everyone,,
Does anyone know a way to capture a desktop (es secondary) while another one is active/shown (es primary)?
I've tryed bitblt, printscreen and printwindow without success.
Any hint?
Regards,
Somic
Does anyone know a way to capture a desktop (es secondary) while another one is active/shown (es primary)?
I've tryed bitblt, printscreen and printwindow without success.
Any hint?
Regards,
Somic
- netmaestro
- PureBasic Bullfrog
- Posts: 8425
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
I testet on XP-Home and the Test-Window is on Default-Desktop and i can´t close desktop 2. How to close desktop 2 or change desktop?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Kiosk System
hello, sorry bumping that old thread.
But does anyone know how to get SetThreadDesktop working here?
It fails, so one stuck on the new desktop, without a way to close the window and return to the normal desktop
But does anyone know how to get SetThreadDesktop working here?
It fails, so one stuck on the new desktop, without a way to close the window and return to the normal desktop
Re: Kiosk System
Hi jared
This is an old thread perhaps the author is not aware of it anymore
You can start from here
Press Esc to switch to the default desktop
Good luck
This is an old thread perhaps the author is not aware of it anymore
You can start from here
Press Esc to switch to the default desktop
Good luck
Code: Select all
#WINSTA_ALL = #WINSTA_ACCESSCLIPBOARD | #WINSTA_ACCESSGLOBALATOMS | #WINSTA_CREATEDESKTOP | #WINSTA_ENUMDESKTOPS | #WINSTA_ENUMERATE | #WINSTA_EXITWINDOWS | #WINSTA_READATTRIBUTES | #WINSTA_READSCREEN | #WINSTA_WRITEATTRIBUTES | #DELETE | #READ_CONTROL | #WRITE_DAC | #WRITE_OWNER
#DESKTOP_ALL = #DESKTOP_READOBJECTS | #DESKTOP_CREATEWINDOW | #DESKTOP_CREATEMENU | #DESKTOP_HOOKCONTROL | #DESKTOP_JOURNALRECORD | #DESKTOP_JOURNALPLAYBACK | #DESKTOP_ENUMERATE | #DESKTOP_WRITEOBJECTS | #DESKTOP_SWITCHDESKTOP | #STANDARD_RIGHTS_REQUIRED
#UOI_NAME = $2
Global m_sDesktop.s,hDesk,hDesk_2
m_sDesktop = Space(128)
Global cmdline$
cmdline$="C:\WINDOWS\system32\notepad.exe"
Procedure.s GetDesktopName()
Protected hDesktop, lR, lSize, sBuff.s, iPos
hDefaultDesk = OpenInputDesktop_(0, #False, #DESKTOP_READOBJECTS)
If hDefaultDesk
lSize = (Len(m_sDesktop) + 1) * 2
sBuff=Space(lSize+1)
lR = GetUserObjectInformation_(hDefaultDesk, #UOI_NAME, @sBuff, lSize, @lSize)
CloseHandle_(hDesktop)
EndIf
ProcedureReturn sBuff
EndProcedure
;hWinSta = OpenWindowStation_("WinSta0", 0, #WINSTA_ALL)
;hDefaultDesk = OpenDesktop_("Default", #DF_ALLOWOTHERACCOUNTHOOK, 0, #DESKTOP_SWITCHDESKTOP)
;Chk(hDefaultDesk, "Failed to open default desktop")
hDesk = CreateDesktop_("My Desktop 2", 0, 0, #DF_ALLOWOTHERACCOUNTHOOK, #DESKTOP_ALL, 0)
SetThreadDesktop_(hDesk)
SwitchDesktop_(hDesk)
OpenWindow(1, 0, 0, 0, 0, "", #PB_Window_BorderLess )
m_sDesktop = GetDesktopName()
tSi.STARTUPINFO
tSi\lpTitle = @m_sDesktop
tSi\lpDesktop = @m_sDesktop
;
; tPi.PROCESS_INFORMATION
;
;
Result = CreateProcess_(#NUL,@cmdline$,#NUL,#NUL,#False,0,#NUL,#NUL,@tSi,@tPi)
Repeat
Delay(1)
Until GetAsyncKeyState_(#VK_ESCAPE) & $8000 = 32768
;TerminateThread_(GetThreadDesktop_(GetCurrentThreadId_()), 0)
hDesk_d = OpenDesktop_("Default", 0, #False, #DESKTOP_SWITCHDESKTOP)
SwitchDesktop_(hDesk_d)
SetThreadDesktop_(hDesk_d)
;CloseDesktop_(hDesk)
Egypt my love
Re: Kiosk System
Thank you, RASHAD, that works.
Still one thing i wonder about. why would a messagerequester display on the old desktop after using SetThreadDesktop_(hDesk) and SwitchDesktop_(hDesk)?
Still one thing i wonder about. why would a messagerequester display on the old desktop after using SetThreadDesktop_(hDesk) and SwitchDesktop_(hDesk)?
Re: Kiosk System
Although old, this is still very useful
AMD FX-8350 @ ~4.8GHz | 8GB Corsair DDR3-SDRAM @ 1800Mhz | 7even Ult & Manjaro 0.8.7.1 | PB 5.3
Web: rudz.dk
Web: rudz.dk
Re: Kiosk System
Hello
The code dont work with PB5.60, its hang. SetThreadDesktop_ give a error 170.
PB4.60 work nicely.
How can it solve ?
Lite
The code dont work with PB5.60, its hang. SetThreadDesktop_ give a error 170.
PB4.60 work nicely.
How can it solve ?
Lite
Re: Kiosk System
Comment out the OpenWindow() line.
Re: Kiosk System
Thanks it works, but i need a window.
Solution ??
Lite
Solution ??
Lite
Re: Kiosk System
Try a new thread that has no window.