delphi - A form that does not handle mouse and keyboard event -


this question has answer here:

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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -