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 22 Oct 2010, 23:48
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: 20459
Location: In your JS exploiting you and your system
revolution 23 Oct 2010, 00:01
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: 4624
Location: Argentina
LocoDelAssembly 23 Oct 2010, 00:03
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 23 Oct 2010, 02:56
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 23 Oct 2010, 22:47
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: 20459
Location: In your JS exploiting you and your system
revolution 23 Oct 2010, 23:22
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 23 Oct 2010, 23:54
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: 20459
Location: In your JS exploiting you and your system
revolution 24 Oct 2010, 00:03
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 24 Oct 2010, 19:05
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.