flat assembler
Message board for the users of flat assembler.

Index > Windows > How to create a process when pressing a button?

Author
Thread Post new topic Reply to topic
Fred



Joined: 22 Oct 2010
Posts: 39
Fred
I'm new to (f)asm, so I tried making a simple windows proggy. It's pretty much based on the example\template.ASM and then some additions i made.
Now... it all works fine when compiling from fasmw, but starting the .exe gives a "don't send" error - but just the first time starting it. I have tried some stuff to fix it, but I'm not even sure of what causes it.

Here's the code if you want to see it.

It's probably just some silly error, but I can't detect such things yet. :P


Last edited by Fred on 23 Oct 2010, 22:47; edited 1 time in total
Post 22 Oct 2010, 23:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17338
Location: In your JS exploiting you and your system
revolution
The problem appears to be here:
Code:
  invoke LoadIcon    
You need to provide two parameters to the LoadIcon function.
Post 23 Oct 2010, 00:01
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
The problem seems to be in your LoadIcon call, not sure why I can trigger the error when loading from console only (besides favorable stack contents). You should use "invoke LoadIcon,0,IDI_APPLICATION" (if you meant to follow the template), not "invoke LoadIcon".
Post 23 Oct 2010, 00:03
View user's profile Send private message Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred
Bah, what a miss. >_>

Thanks guys! :P
Post 23 Oct 2010, 02:56
View user's profile Send private message Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred
Okay, so I have my awesome sucky program here with a button. Say I want to run some other .exe when pressing the button (and send along some command line arguments). How would I go about to do something like that?
Post 23 Oct 2010, 22:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17338
Location: In your JS exploiting you and your system
revolution
Code:
invoke CreateProcess,...    
Post 23 Oct 2010, 23:22
View user's profile Send private message Visit poster's website Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred
Seems about right, thanks. I'm not very good at hunting down stuff on msdn, heh.
Post 23 Oct 2010, 23:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17338
Location: In your JS exploiting you and your system
revolution
Fred wrote:
I'm not very good at hunting down stuff on msdn, heh.
Use google.
Post 24 Oct 2010, 00:03
View user's profile Send private message Visit poster's website Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred
If I knew what to search for sure. : P
Post 24 Oct 2010, 19:05
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.