flat assembler
Message board for the users of flat assembler.

Index > Windows > SendMessage help

Author
Thread Post new topic Reply to topic
jacko221



Joined: 12 Nov 2005
Posts: 22
jacko221 12 Nov 2005, 10:05
Hello every one. I decided to learn FASM cause i was sick of C#. So i started of with some basics and now i want to close TaskManager with the SendMessage API. But i get this error with the SendMessage part (Invoke Send,Message,ebx,_f,_g,0) If some one could correct and explain the errors i made in the program i would be very greatful for your time. The code i have made so far is below.

Code:
format PE GUI

include 'C:\fasmw164\INCLUDE\win32a.inc'
mov ebx, FindWindow + _window +  _windowName
Invoke SendMessage,ebx,_f,_g,0
Invoke ExitProcess,0
 

_f db '0x0112'
_g db '0xF060'
;using Spy++ from VC++ 6 i found the task Manager ID thingo
_window db '#32770',0
_windowName db 'Task Manager',0

data import
library user32,'user32.dll',kernel32,'kernel32.dll'
include 'C:\fasmw164\INCLUDE\apia\user32.inc'
include 'C:\fasmw164\INCLUDE\apia\kernel32.inc'
end data
    
Post 12 Nov 2005, 10:05
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 12 Nov 2005, 11:27
hopefully, this might help you a bit
Code:
format PE GUI

include "%fasminc%\win32a.inc"

invoke  FindWindow,NULL,tmWindowName
        cmp eax,NULL
        je e1
invoke  SendMessage,eax,WM_CLOSE,NULL,NULL
invoke  ExitProcess,0
e1:
invoke  MessageBox,NULL,tmWindowName,tmWindowName,MB_OK
invoke  ExitProcess,0

tmWindowName    db 'Windows Task Manager',0

data import
library user32, "user32.dll", kernel32, "kernel32.dll"
include "%fasminc%\apia\kernel32.inc"
include "%fasminc%\apia\user32.inc"
end data
    
Post 12 Nov 2005, 11:27
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 12 Nov 2005, 11:32
open up the Windows Task Manager window so that if you assemble the above code, it would close it down.

btw, you could set in ur pc env variables
Code:
path=C:\fasmw164
fasminc=C:\fasmw164\INCLUDE\
    

so that it looks more friendly Smile and ease your task if you change path later.
Post 12 Nov 2005, 11:32
View user's profile Send private message Visit poster's website Reply with quote
jacko221



Joined: 12 Nov 2005
Posts: 22
jacko221 12 Nov 2005, 11:58
Thank for the tips and the code... really appreciate your help... works great too Smile
Post 12 Nov 2005, 11:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.