flat assembler
Message board for the users of flat assembler.
Index
> Windows > efficient macro or simalar loop. |
Author |
|
r22 24 Nov 2005, 06:11
If you want it to search for a particular window and kill it why are you using a loop?
Shouldn't you only have to find the window once and kill it? Your continually looking for it. If you want your current code to not use up so much CPU then add a delay in it. Use the Sleep api in kernel32.dll and add a delay to your infinite loop. |
|||
24 Nov 2005, 06:11 |
|
revolution 24 Nov 2005, 07:52
To add to r22's post try this:
Code: format PE GUI include "C:\fasmw164\INCLUDE\win32ax.inc" .data tmWindowName db 'Game Emulator',0 .code start: start1: invoke Sleep,100 ;<--- this line added push tmWindowName push NULL call [FindWindow] .if eax,be,NULL ;around here is makeing it very slow jmp start1 .endif jmp start2 start2: invoke SendMessage, eax, WM_CLOSE, NULL, NULL jmp start1 |
|||
24 Nov 2005, 07:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.