delphi - A form that does not handle mouse and keyboard event -
this question has answer here:
- click through transparent form 1 answer
i want make form in delphi not handle mouse , keyboard events , pass them window below itself. how can this?
you can make use of procedure blockinput of user32.dll
you can try (with caution!):
procedure bloqued(block:boolean); var milib: thandle; blockinput : function(block: bool): bool; stdcall; begin milib := getmodulehandle('user32.dll'); if milib <> 0 begin @blockinput := getprocaddress(milib, 'blockinput'); if @blockinput <> nil begin blockinput(block); end; end; end; procedure tform1.button1click(sender: tobject) ; begin bloqued(true); sleep(1000); bloqued(false); end;
version without dinamic loading:
function blockinput (block: bool): bool; stdcall; external 'user32.dll'; procedure tform1.button1click(sender: tobject); begin blockinput(true); sleep(1000); blockinput(false); end;
Comments
Post a Comment