Jump to content
Tuts 4 You

Edit History

LCF-AT

LCF-AT

Hey kao,

it works! :) I just testet your code in the example source I have attached before and its working.Great kao.I thought already it wouldnt be possible to do this anyhow or something but now you came up with a working solution hehe. :) 

Yes,I will try to write this code similar in my app where I wanna have it and make some test running it into Sandboxie etc.I will send some feedback later whether all is working fine or whether I get any new problem.

greetz

EDIT: I see your code / example you found is working so far but not for all.If I have Olly open and do copy something then its just working by random anyhow.Sometimes it works and sometimes not and my app icon in taskbar below does just flash.Not sure about that.In Notepad or browser it seems to work for 100 % til now.I did rewrote your code example to this now....

            invoke GetForegroundWindow
            mov esi, eax
            invoke GetCurrentThreadId
            mov ebx, eax
            invoke GetWindowThreadProcessId,esi,FALSE
            mov edi, eax
            push ebx
            .if ebx != edi
                invoke AttachThreadInput,ebx,edi, TRUE
                invoke SystemParametersInfo,SPI_GETFOREGROUNDLOCKTIMEOUT,FALSE,addr lockTimeOut,0
                invoke SystemParametersInfo,SPI_SETFOREGROUNDLOCKTIMEOUT,FALSE,0,SPIF_SENDWININICHANGE or SPIF_UPDATEINIFILE
                invoke AllowSetForegroundWindow,ASFW_ANY
            .endif
            invoke SetForegroundWindow,hWin
            pop ebx
            .if ebx != edi
                invoke SystemParametersInfo,SPI_SETFOREGROUNDLOCKTIMEOUT,FALSE,addr lockTimeOut,SPIF_SENDWININICHANGE or SPIF_UPDATEINIFILE
                invoke AttachThreadInput,ebx,edi, FALSE
            .endif

...should be right if I have read this C source code correctly.

LCF-AT

LCF-AT

Hey kao,

it works! :) I just testet your code in the example source I have attached before and its working.Great kao.I thought already it wouldnt be possible to do this anyhow or something but now you came up with a working solution hehe. :) 

Yes,I will try to write this code similar in my app where I wanna have it and make some test running it into Sandboxie etc.I will send some feedback later whether all is working fine or whether I get any new problem.

greetz

×
×
  • Create New...