flat assembler
Message board for the users of flat assembler.

Index > Windows > How to acces to the Ole properties

Author
Thread Post new topic Reply to topic
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
i'm looking for some information about how to create and acces to OLE OBJECTS and browse webpages in my application thx
Post 30 Oct 2004, 23:01
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
It would be very hard with assembly.

I attach an example in pure C (no C++) and MASM.


Description: masm
Download
Filename: webbrowser.zip
Filesize: 24.08 KB
Downloaded: 129 Time(s)

Description: example in C
Download
Filename: cwebpage.zip
Filesize: 46.73 KB
Downloaded: 128 Time(s)


_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 30 Oct 2004, 23:46
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
Thanx comrade, your example really help me. I tried to do that uisng the ole classes, but I didn't find the CLSID of the WebBrowser Objects, it isn't in he the header files of the Visual C++ 6.0.
Post 02 Nov 2004, 16:55
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
those aren't my examples Smile
Post 02 Nov 2004, 18:26
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
Well Anyway, you gave those examples, so i thank U,
Post 02 Nov 2004, 22:21
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
hi, i try to convert the browser MASM code into FASM version
i don't know which part i might get wrong, coz i couldn't find it Sad
upon execution, it coz stack fault but the application is able to display
the requested webpage normally.

Code:
BROWSER caused a stack fault in module SHLWAPI.DLL at 0137:70bd3381.
Registers:
EAX=00534750 CS=0137 EIP=70bd3381 EFLGS=00010246
EBX=00000000 SS=013f ESP=00531ee0 EBP=00532310
ECX=00532108 DS=013f ESI=70e91308 FS=3a87
EDX=d205228c ES=013f EDI=00000104 GS=0000
Bytes at CS:EIP:
57 56 53 8d 8d d0 fb ff ff ff 75 0c e8 68 e9 ff 
Stack dump:
00000000 00000000 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000 
00000000 
    


Code:
format PE GUI 4.0
include '%fasminc%\win32a.inc'
entry start

IDD_DIALOG1 equ 101
IDC_WBR1     equ 1001
WBM_NAVIGATE        equ WM_USER+100

section '.data' data readable writeable
    wndClsName      db 'WB_DEMO',0
    wndTitle        db 'The Hello Program',0

      wndCls  WNDCLASSEX
  wndMsg  MSG

     wbDllName       db 'wbdll.dll',0

      url1            db 'H:\sulaiman_v2\fasm\tut_24.html',0

 rect            RECT

section '.sdata' readable shareable writeable
 insH            dd ?
        cmdLine         dd ?
        wbDllH          dd ?
        wndH            dd ?

section '.code' code readable executable
start:
        invoke  GetModuleHandle,NULL
                mov  [insH],eax
     invoke  InitCommonControls
  invoke  LoadLibrary,wbDllName
               mov  [wbDllH],eax
   invoke  GetCommandLine
              mov  [cmdLine],eax

              mov  [wndCls.cbSize],sizeof.WNDCLASSEX
              mov  [wndCls.style],CS_HREDRAW + CS_VREDRAW
         mov  [wndCls.lpfnWndProc],proc_window
               mov  [wndCls.cbClsExtra],NULL
               mov  [wndCls.cbWndExtra],DLGWINDOWEXTRA
             push [insH]
         pop  [wndCls.hInstance]
             mov  [wndCls.hbrBackground],COLOR_BTNFACE + 1
               mov  [wndCls.lpszMenuName],NULL
             mov  [wndCls.lpszClassName],wndClsName
      invoke  LoadIcon,NULL,IDI_APPLICATION
               mov  [wndCls.hIcon],eax
             mov  [wndCls.hIconSm],eax
   invoke  LoadCursor,NULL,IDC_ARROW
           mov  [wndCls.hCursor],eax
   invoke  RegisterClassEx,wndCls
      invoke  CreateDialogParam,[insH],IDD_DIALOG1,NULL,proc_window,NULL
  invoke  ShowWindow,[wndH],SW_SHOWNORMAL
     invoke  UpdateWindow,[wndH]

window_message_loop_start:
   invoke  GetMessage,wndMsg,NULL,0,0
          or   eax,eax
                je   window_message_loop_end
        invoke  TranslateMessage,wndMsg
     invoke  DispatchMessage,wndMsg
              jmp  window_message_loop_start
window_message_loop_end:
      invoke  FreeLibrary,[wbDllH]
        invoke  ExitProcess,0


proc proc_window,hWnd,uMsg,wParam,lParam
           push ebx esi edi
            cmp  [uMsg],WM_INITDIALOG
           je   .wmINITDIALOG
          cmp  [uMsg],WM_SIZE
         je   .wmSIZE
                cmp  [uMsg],WM_DESTROY
              je   .wmDESTROY
             cmp  [uMsg],WM_CLOSE
                je   .wmCLOSE

   .wmDEFAULT:
             invoke  DefWindowProc,[hWnd],[uMsg],[wParam],[lParam]
                       jmp  .wmBYE

     .wmINITDIALOG:
                  mov  eax,[hWnd]
                     mov  [wndH],eax
             invoke  SendDlgItemMessage,[hWnd],IDC_WBR1,WBM_NAVIGATE,0,url1
                      jmp  .wmBYE

     .wmSIZE:
                invoke  GetClientRect,[hWnd],rect
                   add  [rect.top],30
                  sub  [rect.bottom],30
               invoke  GetDlgItem,[hWnd],IDC_WBR1
                  mov  edx,[rect.bottom]
                      shr  edx,1
          invoke  MoveWindow,eax,[rect.left],[rect.top],[rect.right],edx,TRUE
                 jmp  .wmBYE

     .wmCLOSE:
               invoke  DestroyWindow,[hWnd]
                        jmp  .wmBYE

     .wmDESTROY:
             invoke  PostQuitMessage,NULL
                        jmp  .wmBYE

     .wmBYE:
         pop  edi esi ebx
            return
endp

section '.idata' import data readable
library        kernel32,'KERNEL32.DLL',\
        user32,  'USER32.DLL',\
  comctl32,'COMCTL32.DLL'

include '%fasminc%\apia\Kernel32.inc'
include '%fasminc%\apia\User32.inc'
include '%fasminc%\apia\Comctl32.inc'

section '.rsrc' resource from "browser.res"
    
Post 19 Dec 2004, 04:19
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
files


Description: all files in side
Download
Filename: browser.rar
Filesize: 6.39 KB
Downloaded: 108 Time(s)

Post 19 Dec 2004, 04:21
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Code:
proc proc_window,hWnd,uMsg,wParam,lParam 
                push ebx esi edi 
    

shouldn't there be some "enter" macro?
Post 19 Dec 2004, 12:17
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
Code:
WndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
  LOCAL   rect:RECT
    


i thought it is the same as below in my code

Code:
section '.data' data readable writeable 
    rect            RECT 
    


by the way, i tried ur suggestion but the result still the same Sad
Code:
proc proc_window,hWnd,uMsg,wParam,lParam
        rect RECT
   enter

...

        .wmSIZE:
                        lea  eax,[rect]
             invoke  GetClientRect,[hWnd],eax
                    add  [rect.top],30
                  sub  [rect.bottom],30
               invoke  GetDlgItem,[hWnd],IDC_WBR1
                  mov  edx,[rect.bottom]
                      shr  edx,1
          invoke  MoveWindow,eax,[rect.left],[rect.top],[rect.right],edx,TRUE
                 jmp  .wmBYE
    
Post 19 Dec 2004, 12:54
View user's profile Send private message Visit poster's website 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.