Hey another question for you guys :confused: ,
Is there a way to call Windows Calculator from inside your program? Like for example if a user clicks a certain button, then Windows Calculator is ran. Any examples by chance?

Thx,
RIF
Posted on 2003-02-07 18:26:31 by resistance_is_futile
Posted on 2003-02-07 18:34:16 by kairon
I tried it but it gives me an error when the button is pushed:



calc db 'C:\WINDOWS\System32\calc.exe',0
calc1 db 'C:\WINDOWS\SYSTEM32\',0

;If calculator is selected
.if wParam == 10004
invoke CreateProcess,addr calc,NULL,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,addr calc1,addr start1,addr process
.endif


Any help on this is appreciated....

RIF
Posted on 2003-02-07 19:22:42 by resistance_is_futile
.const

szActionOpen db "open", 0
szCalculatorExecutable db "calc.exe", 0
szPathFormat db "%s\%s", 0
.data?
szExecutable db MAX_PATH dup (?)
szSysDir db MAX_PATH dup (?)
.code
invoke GetSystemDirectory, ADDR szSysDir, sizeof szSysDir
invoke wsprintf, ADDR szExecutable, ADDR szPathFormat, ADDR szSysDir, ADDR szCalculatorExecutable
invoke ShellExecute, 0, ADDR szActionOpen, ADDR szExecutable, 0, 0, SW_SHOW
Posted on 2003-02-07 19:33:28 by comrade
Thanks comrade.

RIF
Posted on 2003-02-08 00:13:12 by resistance_is_futile
You will find that WinExec() works fine on all versions of Windows. If you don't need the extra info from CreateProcess, its just less typing.


invoke WinExec,ADDR FileName,SW_SHOW

Regards,

hutch@movsd.com
Posted on 2003-02-08 04:04:13 by hutch--
resistance_is_futile,

Do you remember for your thread "automatic typing??"
Check the example of WinExec:

http://www.asmcommunity.net/board/showthread.php?s=&postid=60734.msg60734
Posted on 2003-02-08 07:16:51 by Vortex
Okay thanks for all the quick replies...Does winexec work for any type of program as well? Or just windows programs?
Posted on 2003-02-08 13:03:15 by resistance_is_futile

Okay thanks for all the quick replies...Does winexec work for any type of program as well? Or just windows programs?


No, it doesnt work on Linux binaries.
Posted on 2003-02-08 13:27:30 by bazik

Okay thanks for all the quick replies...Does winexec work for any type of program as well? Or just windows programs?


If you don't specify a directory path WinExec will search system directories and the PATH environment. Kinda like what a DOS box does when you type something.
Posted on 2003-02-08 13:36:46 by iblis