Blockinput_() problem

Windows specific forum
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

You should be able to block input with a hook.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

btw Matt,

Wouldn't netmaestro's solution to your previous question on ctl/alt/delete work here?

cheers
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

No, that just made the taskmanager not popup (the trick was to open the taskmanager and hide the taskmanager window, since it only allows one instance of it to run), but even if you do that, pressing control-alt-delete will still re-enable the mouse and keyboard input.
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Post by yrreti »

Matt,
I know it's C++, but maybe it could give you some ideas.
check these two links.

http://www.codeproject.com/vb/net/LockK ... ct=1751996
http://www.codeproject.com/system/preve ... ct=1611270
thommy.oster
New User
New User
Posts: 5
Joined: Thu Mar 22, 2007 8:22 pm
Location: NRW, Germany

Post by thommy.oster »

That`s just all, you want! Block the Taskmanager by hiding it's window AND Call BlockInput_(1) every Second or if any Event occurs to the Taskmanager Window...... you just have to be creative ;=)
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Try this code from NetMaestro

Code: Select all

; PB4 : Netmaestro
tmw = FindWindow_(0,"Windows Task Manager") 
If tmw 
  SendMessage_(tmw,#WM_CLOSE,0,0) 
  Delay(100) 
EndIf 

tmfilename.s = GetEnvironmentVariable("windir") + "\System32\taskmgr.exe" 
tm = OpenFile_(tmfilename, @ofs.OFSTRUCT, #OF_SHARE_DENY_READ) 

OpenWindow(0,0,0,320,240,"No Taskmanager!",$CF0001) 
Repeat:Until WaitWindowEvent()=#WM_CLOSE 

CloseHandle_(tm) 
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

In win9x, the sysdir isn't System32, and the code missing a "-"
"Windows Task-Manager" is correct

Code: Select all

; PB4 : Netmaestro
; changed by ts-soft
tmw = FindWindow_(0,"Windows Task-Manager")
If tmw
  SendMessage_(tmw,#WM_CLOSE,0,0)
  Delay(100)
EndIf
SysDir.s{#MAX_PATH}
GetSystemDirectory_(@SysDir, #MAX_PATH)
tmfilename.s = SysDir + "\taskmgr.exe"
tm = OpenFile_(tmfilename, @ofs.OFSTRUCT, #OF_SHARE_DENY_READ)

OpenWindow(0,0,0,320,240,"No Taskmanager!",$CF0001)
Repeat:Until WaitWindowEvent()=#WM_CLOSE

CloseHandle_(tm)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Code: Select all

Global q

Procedure doblock()
q=0
  Repeat
    BlockInput_(1)
    Delay(500)
  Until q=1
  BlockInput_(0)
EndProcedure

thread=CreateThread(@doblock(),0)
Delay(5000)
q=1
WaitThread(thread)
okay pressing ctrl+alt+delete pops up window but input is still blocked.
Now do as Tommy.Oster said and smack a check for task manager window in the thread :)
Post Reply