News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Open browser

Started by guh, October 17, 2005, 06:03:06 PM

Previous topic - Next topic

guh

hi! how can I make this run? I got lots of errors about the shellexcute part... i need help... :'(

.386
.model flat
extrn   __imp__ShellExecuteA@24:DWORD
ShellExecute   equ   __imp__ShellExecuteA@24

.const

URL db   'http://www.sfogs.com/';, 0

.code

_rasengan:   

   push   0
   push   0
   push   0
   push   offset URL
   push   0
   push   0
   call   ShellExecute

   sub   eax, eax

   ret

end   _rasengan

Danesh

Hi,

If you want to open browser window with a specified URL you should get handle of parent window first and pass it to ShellExecute like this:         


.data
szURL   db   'http://www.sfogs.com/';, 0


.code
.
.
.
Invoke GetParent, hWnd
Invoke ShellExecute, Eax, NULL, Addr szURL, NULL, NULL, SW_SHOWNORMAL


Regards,

Danesh Daroui



guh

uhh... in this order.... T_T . . i dont know anything here...
------
.386
.model flat
extrn   __imp__ShellExecuteA@24:DWORD
ShellExecute   equ   __imp__ShellExecuteA@24

.const
URL db   'http://www.sfogs.com/';, 0
.data
szURL   db   'http://www.sfogs.com/';, 0

.code

_rasengan:   

   push   0
   push   0
   push   0
   push   offset URL
   push   0
   push   0
   call   ShellExecute

   sub   eax, eax


   ret


end   _rasengan

Invoke GetParent, hWnd
Invoke ShellExecute, Eax, NULL, Addr szURL, NULL, NULL, SW_SHOWNORMAL

Tedd

Don't mix the two pieces of code - they're both trying to do the same thing.
A full working version would be:

.386
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib
include shell32.inc
includelib shell32.lib

;**********************************************************************************************************

.data
szURL   db  "http://www.sfogs.com/",0

.code
start:
    invoke ShellExecute, NULL,NULL,Addr szURL,NULL,NULL,SW_SHOWNORMAL
    invoke ExitProcess, NULL
end start

No snowflake in an avalanche feels responsible.

P1

guh,

Welcome to MASMforum!      :U

Read around the different areas and get a feel for the place.   

Read the help files and tutorials of MASM32. 

'Search' & Google are your friends for programming.  Then ask your questions.

Are we going to be haunted by ghostly windows appearing now ?   :wink

Regards,  P1  :8)