64位汇编语言之COMWebBrowser(64位汇编语言之COMWebBrowser)
64位汇编语言之COMWebBrowser(64位汇编语言之COMWebBrowser)
com 是个很大的课题,本人感觉比驱动还要繁杂,基础知识就不再讲解了,有兴趣的朋友可以看下这本书:
这是运行效果:
本汇编代码已以文档方式导入,以下是部分代码:
inter_explorer_WndProc proc uses rbx rdi rsi _hWin:qword _uMsg:qword _wParam:qword _lParam:qword
LOCAL @rect:RECT
LOCAL @pwnd:qword
local @stRect:RECT
local @stPs:PAINTSTRUCT
LOCAL @wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL @hwnd:HWND
LOCAL @flags:qword
LOCAL @ppIOleInPlaceActiveObject:qword
mov rax _uMsg
.if eax==WM_CREATE
;.elseif eax == WM_MOUSEMOVE
.elseif eax == WM_USER 1
nop
;
invoke IsWindow _hWin
.if eax {} 0
invoke GetWindow _hWin GW_CHILD
mov ebx eax
invoke GetClassName rbx addr @wc sizeof @wc
invoke lstrcmp addr @wc addr Shell_Embedding;若两个字符串相等则返回值为0。
.if eax == 0
mov esi 5
.while sdword ptr esi }0
invoke GetWindow rbx GW_CHILD
mov rbx rax
invoke GetClassName rbx addr @wc sizeof @wc
invoke lstrcmp addr @wc addr Internet_Explorer_Server;若两个字符串相等则返回值为0。
.if eax == 0
invoke SetFocus rbx
invoke SetActiveWindow rbx
invoke SetForegroundWindow rbx
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.QueryInterface] pWB2 addr IID_IOleInPlaceActiveObject addr @ppIOleInPlaceActiveObject
mov rbx @ppIOleInPlaceActiveObject
mov rbx [rbx]
invoke [rbx _IOleInPlaceActiveObject.OnFrameWindowActivate] @ppIOleInPlaceActiveObject 1
invoke [rbx _IOleInPlaceActiveObject.iolewindow._IUnknown.Release] @ppIOleInPlaceActiveObject
.break
.endif
dec esi
.if esi == 0
.break
.endif
.endw
.endif
.endif
.elseif eax == WM_PAINT
invoke BeginPaint _hWin addr @stPs
invoke EndPaint _hWin addr @stPs
.elseif eax==WM_CLOSE
;
invoke CoUninitialize
; invoke PostQuitMessage NULL
; invoke DestroyWindow child_hwnd
; invoke DestroyWindow hWnd
invoke DestroyWindow _hWin
; invoke PostQuitMessage NULL
;; invoke TerminateThread rax 0
; invoke GetCurrentProcess
; invoke TerminateProcess rax 0
.elseif eax ==WM_DESTROY
invoke PostQuitMessage NULL
; invoke GetCurrentThread
; invoke TerminateThread rax 0
; invoke GetCurrentProcess
; invoke TerminateProcess rax 0
.else
invoke DefWindowProc _hWin _uMsg _wParam _lParam
ret
.endif
mov eax 0
ret
inter_explorer_WndProc endp
inter_explorer_thread proc uses rbx rsi rdi _hWin:qword
LOCAL @rect:RECT
LOCAL @wc:WNDCLASSEX
LOCAL @msg:MSG
LOCAL @parenthand:qword
LOCAL @IConnectionPointContainer:qword
LOCAL @DWebBrowserEvents2:qword
LOCAL @IConnectionPoint:qword
LOCAL @varinat:VARIANT
LOCAL @extent:qword
LOCAL @inplace:qword
LOCAL @classhand:qword
LOCAL @stRect:RECT
; invoke InitCommonControls
invoke CoInitialize NULL
; invoke CoInitializeEx
mov rax _hWin
mov @parenthand rax
invoke RtlZeroMemory addr @wc sizeof @wc
mov @wc.cbSize SIZEOF WNDCLASSEX
mov @wc.style CS_HREDRAW or CS_VREDRAW; CS_DBLCLKS;
lea rax inter_explorer_WndProc
mov @wc.lpfnWndProc rax;OFFSET inter_explorer_WndProc
mov @wc.cbClsExtra NULL
mov @wc.cbWndExtra NULL
push hInstance
pop @wc.hInstance
mov @wc.hbrBackground COLOR_BTNFACE 1
mov @wc.lpszMenuName NULL
lea rax ClassName_for_html
mov @wc.lpszClassName rax;OFFSET ClassName_for_html
invoke LoadCursor NULL IDC_ARROW
mov @wc.hCursor rax
invoke RegisterClassEx addr @wc
mov @classhand rax
invoke GetDlgItem _hWin 1001
invoke GetClientRect rax addr @rect
mov esi @rect.right
mov edi @rect.left
sub esi edi
mov edi @rect.bottom
sub edi @rect.top
; invoke GetDesktopWindow
invoke CreateWindowEx 0h @classhand 0 WS_CHILD WS_CLIPSIBLINGS WS_CLIPCHILDREN 0 0 rsi rdi _hWin 11111 hInstance NULL
mov _iOleClientSiteEx.inplace._frame.window rax
;invoke SetParent rax _hWin;hWnd
invoke ShowWindow _iOleClientSiteEx.inplace._frame.window SW_SHOW
invoke UpdateWindow _iOLEClientSiteEx.inplace._frame.window
invoke inihtml
invoke CoGetClassObject addr CLSID_WebBrowser CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER 0 addr IID_IClassFactory addr punk;CLSCTX_INPROC_SERVER equ 1 or CLSCTX_INPROC_HANDLER equ 2 CLSCTX_ALL
.if rax {} S_OK
mov rax 0
ret
.endif
mov rbx punk
mov rbx [rbx]
invoke [rbx fix_IClassFactory.CreateInstance] punk 0 addr IID_IOleObject addr pObject
.if rax {} S_OK
mov rax 0
ret
.endif
invoke [rbx fix_IClassFactory._IUnknown.Release] punk
mov rbx pObject
mov rbx [rbx]
lea rdx @_myIOleClientSiteEx
invoke [rbx fix_IOleObject.SetClientSite] pObject rdx;
.if rax {} S_OK
mov rax 0
ret
.endif
invoke OleSetContainedObject pObject 1 ; Let browser object know that it is embedded in an OLE container.
.if rax {} S_OK
mov rax 0
ret
.endif
invoke GetClientRect _hWin addr @rect
.if rax == 0
mov rax 0
ret
.endif
OLEIVERB_PRIMARY EQU 0
OLEIVERB_SHOW EQU - 1
OLEIVERB_OPEN EQU - 2
OLEIVERB_HIDE EQU - 3
OLEIVERB_UIACTIVATE EQU - 4
OLEIVERB_INPLACEACTIVATE EQU - 5
OLEIVERB_DISCARDUNDOSTATE EQU - 6
;OLEIVERB_SHOW:显示OLE控件。
;OLEIVERB_OPEN:在另外一个窗口中打开OLE控件。
;OLEIVERB_INPLACEACTIVATE:不带有工具栏和菜单栏的方式。
;OLEIVERB_UIACTIVATE:激活OLE的菜单栏和工具栏。
;OLEIVERB_PRIMARY:打开编辑状态的OLE控件。
;OLEIVERB_DISCARDUNDOSTATE:关闭OLE控件。
;
mov rbx pObject
mov rbx [rbx]
lea r9 @_myIOleClientSiteEx
invoke [rbx fix_IOleObject.DoVerb] pObject OLEIVERB_INPLACEACTIVATE 0 r9 0 _iOleClientSiteEx.inplace._frame.window addr @rect
lea rdi @extent
mov eax @rect.right
mov [rdi] eax
mov eax @rect.bottom
mov [rdi 4] eax
; coinvoke pObject IOleObject SetExtent DVASPECT_CONTENT rdi
invoke [rbx fix_IOleObject.SetExtent] pObject rdi
; coinvoke pObject IUnknown_ QueryInterface addr IID_IOleInPlaceObject addr @inplace
invoke [rbx fix_IOleObject._IUnknown.QueryInterface] pObject addr IID_IOleInPlaceObject addr @inplace
; coinvoke @inplace IOleInPlaceObject SetObjectRects addr @rect addr @rect
mov rbx @inplace
mov rbx [rbx]
invoke [rbx fix_IOleInPlaceObject.SetObjectRects] @inplace addr @rect addr @rect
.if eax {} S_OK
mov eax 0
ret
.endif
; coinvoke pObject IUnknown_ QueryInterface addr IID_IWebBrowser2 addr pWB2
mov rbx pObject
mov rbx [rbx]
invoke [rbx fix_IOleObject._IUnknown.QueryInterface] pObject addr IID_IWebBrowser2 addr pWB2
lea rcx pWB2
.if eax {} S_OK
mov eax 0
ret
.endif
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.put_Left] pWB2 0
invoke [rbx IWebBrowser2Vtbl.put_Top] pWB2 0
mov eax @rect.right
invoke [rbx IWebBrowser2Vtbl.put_Width] pWB2 rax
mov eax @rect.bottom
invoke [rbx IWebBrowser2Vtbl.put_Height] pWB2 rax
invoke [rbx IWebBrowser2Vtbl.put_RegisterAsBrowser] pWB2 VARIANT_TRUE
; invoke [rbx IWebBrowser2Vtbl.get_HWND] pWB2 addr browser_hwnd
; invoke [rbx IWebBrowser2Vtbl.put_Visible] pWB2 VARIANT_TRUE;
; invoke [rbx IWebBrowser2Vtbl.put_Silent] pWB2 VARIANT_TRUE;
; invoke [rbx IWebBrowser2Vtbl.put_TheaterMode] pWB2 VARIANT_TRUE;
mov rax browser_hwnd
; comment %
; invoke [rbx IWebBrowser2Vtbl.QueryInterface] pWB2 addr IID_IDispatch addr ppIDispatch
; .if eax {} S_OK
; mov eax 0
; ret
; .endif
invoke [rbx IWebBrowser2Vtbl.get_Application] pWB2 addr pIDispatch
.if eax {} S_OK
mov eax 0
ret
.endif
invoke [rbx IWebBrowser2Vtbl.QueryInterface] pWB2 addr IID_IConnectionPointContainer addr @IConnectionPointContainer
.if eax {} S_OK
mov eax 0
ret
.endif
mov rax @IConnectionPointContainer
mov rbx [rax]
invoke [rbx fix_IConnectionPointContainer.FindConnectionPoint] @IConnectionPointContainer addr DIID_DWebBrowserEvents2 addr pIConnectionPoint_obj
.if eax {} S_OK
mov eax 0
ret
.endif
; IID_IDispatch
;DIID_DWebBrowserEvents2
mov rax pIConnectionPoint_obj
mov rbx [rax]
lea rcx _iOleClientSiteEx.DWebBrowserEvents2._IUnknown.QueryInterface
lea rdi @_myIOleClientSiteEx
lea rdx [rdi 18h 18h]
invoke [rbx fix_IConnectionPoint.Advise] pIConnectionPoint_obj rdx addr dwcookie
.if eax {} S_OK
mov eax 0
ret
.endif
invoke [rbx fix_IConnectionPoint._IUnknown.Release] pIConnectionPoint_obj
; .if eax {} S_OK
; mov eax 0
; ret
; .endif
;
;
mov rax @IConnectionPointContainer
mov rbx [rax]
;计算比例关系
comment ~
invoke GetDlgItem _hWin 1002 ;webbrowser
mov rbx eax
invoke GetWindowRect rbx addr @stRect
invoke ScreenToClient _hWin addr @stRect.left
invoke ScreenToClient _hWin addr @stRect.right
fild @stRect.left
fild org_main_width
fdivp st(1) st(0)
fstp webbrowser_window.x
fild @stRect.top
fild org_main_higth
fdivp st(1) st(0)
fstp webbrowser_window.y
mov eax @stRect.left
sub @stRect.right eax
fild @stRect.right
fild org_main_width
fdivp st(1) st(0)
fstp webbrowser_window._width
mov eax @stRect.top
sub @stRect.bottom eax
fild @stRect.bottom
fild org_main_higth
fdivp st(1) st(0)
fstp webbrowser_window.higth
invoke GetDlgItem _hWin 1005
mov rbx eax
invoke GetWindowRect rbx addr @stRect
invoke ScreenToClient _hWin addr @stRect.left
invoke ScreenToClient _hWin addr @stRect.right
fild @stRect.left
fild org_main_width
fdivp st(1) st(0)
fstp viewnetaddress.x
fild @stRect.top
fild org_main_higth
fdivp st(1) st(0)
fstp viewnetaddress.y
mov eax @stRect.left
sub @stRect.right eax
fild @stRect.right
fild org_main_width
fdivp st(1) st(0)
fstp viewnetaddress._width
mov eax @stRect.top
sub @stRect.bottom eax
fild @stRect.bottom
fild org_main_higth
fdivp st(1) st(0)
fstp viewnetaddress.higth
invoke GetDlgItem _hWin 1003
mov rbx eax
invoke GetWindowRect rbx addr @stRect
invoke ScreenToClient _hWin addr @stRect.left
invoke ScreenToClient _hWin addr @stRect.right
fild @stRect.left
fild org_main_width
fdivp st(1) st(0)
fstp baiduzhuye.x
fild @stRect.top
fild org_main_higth
fdivp st(1) st(0)
fstp baiduzhuye.y
mov eax @stRect.left
sub @stRect.right eax
fild @stRect.right
fild org_main_width
fdivp st(1) st(0)
fstp baiduzhuye._width
mov eax @stRect.top
sub @stRect.bottom eax
fild @stRect.bottom
fild org_main_higth
fdivp st(1) st(0)
fstp baiduzhuye.higth
invoke GetDlgItem _hWin 1001
mov rbx eax
invoke GetWindowRect rbx addr @stRect
invoke ScreenToClient _hWin addr @stRect.left
invoke ScreenToClient _hWin addr @stRect.right
fild @stRect.left
fild org_main_width
fdivp st(1) st(0)
fstp tencentzhuye.x
fild @stRect.top
fild org_main_higth
fdivp st(1) st(0)
fstp tencentzhuye.y
mov eax @stRect.left
sub @stRect.right eax
fild @stRect.right
fild org_main_width
fdivp st(1) st(0)
fstp tencentzhuye._width
mov eax @stRect.top
sub @stRect.bottom eax
fild @stRect.bottom
fild org_main_higth
fdivp st(1) st(0)
fstp tencentzhuye.higth
invoke GetDlgItem _hWin 1004
mov rbx eax
invoke GetWindowRect rbx addr @stRect
invoke ScreenToClient _hWin addr @stRect.left
invoke ScreenToClient _hWin addr @stRect.right
fild @stRect.left
fild org_main_width
fdivp st(1) st(0)
fstp youselfzhuye.x
fild @stRect.top
fild org_main_higth
fdivp st(1) st(0)
fstp youselfzhuye.y
mov eax @stRect.left
sub @stRect.right eax
fild @stRect.right
fild org_main_width
fdivp st(1) st(0)
fstp youselfzhuye._width
mov eax @stRect.top
sub @stRect.bottom eax
fild @stRect.bottom
fild org_main_higth
fdivp st(1) st(0)
fstp youselfzhuye.higth
invoke CreateFontIndirect addr yahei_8
mov hfont_8 eax
invoke CreateFontIndirect addr yahei_9
mov hfont_9 eax
invoke CreateFontIndirect addr yahei_10
mov hfont_10 eax
invoke CreateFontIndirect addr yahei_11
mov hfont_11 eax
invoke CreateFontIndirect addr yahei_12
mov hfont_12 eax
invoke CreateFontIndirect addr yahei_14
mov hfont_14 eax
invoke CreateFontIndirect addr yahei_16
mov hfont_16 eax
comment ~
invoke MultiByteToWideChar CP_ACP 0 addr netaddress_aboutblank -1 addr netbuffer sizeof netbuffer
mov headbuffer rax
lea esi netbuffer
invoke SysAllocString addr netbuffer
mov hsysstring rax
mov _VARIANT_buffer.vt VT_BSTR
mov _VARIANT_buffer.pbstrVal rax
lea eax _VARIANT_buffer
mov rbx pWB2
mov rbx [rbx]
; invoke [rbx IWebBrowser2Vtbl.Navigate2] pWB2 rax 0 0 0 0
invoke SysFreeString hsysstring
invoke PostMessage _iOleClientSiteEx.inplace._frame.window WM_USER 1 0 0
.while TRUE
; invoke PeekMessage addr @msg NULL 0 0 PM_REMOVE
invoke GetMessage addr @msg NULL 0 0
.if rax == 0
.break
.endif
;.if eax
invoke TranslateMessage addr @msg
invoke DispatchMessage addr @msg
.endw
ret
inter_explorer_thread endp
movwindow proc uses rbx rsi rdi hWin:qword id:qword _x:qword _y:qword Porg_rect:qword
local @width:qword ;某个控件的宽度
LOCAL @higth:qword
LOCAL @child_x:qword ;某个控件的x坐标
LOCAL @child_y:qword
LOCAL @rect:RECT
invoke GetDlgItem hWin id
mov rbx rax
invoke GetWindowRect rax addr @rect
invoke ScreenToClient hWin addr @rect.left
invoke ScreenToClient hWin addr @rect.right
mov rsi Porg_rect
fild [rsi RECT.right]
fild [rsi RECT.left]
fsubp st(1) st (0) ;原始宽度
fld _x
fmul st(0) st (1) ;;原始宽度*缩放率
faddp st(1) st (0) ;;原始宽度 原始宽度*缩放率
fistp @width
fild [rsi RECT.bottom]
fild [rsi RECT.top]
fsubp st(1) st (0) ;原始高度
fld _y
fmul st(0) st (1) ;;原始高度*缩放率
faddp st(1) st (0) ;;原始高度 原始高度*缩放率
fistp @higth
fild [rsi RECT.left];x坐标
fld _x
fmul st(0) st (1) ;;原始x坐标*缩放率
faddp st(1) st (0)
fistp @child_x
fild [rsi RECT.top];y坐标
fld _y
fmul st(0) st (1) ;;原始y坐标*缩放率
faddp st(1) st (0)
; fld float05
; fmulp st(1) st (0)
fistp @child_y
; sub @child_y 15
mov eax [rsi RECT.bottom]
sub eax [rsi RECT.top]
.if rax {= @higth
; mov @higth rax
.endif
invoke MoveWindow rbx @child_x @child_y @width @higth TRUE
ret
movwindow endp
WndProc proc uses rbx rsi rdi hWin:HWND uMsg:UINT64 wParam:WPARAM lParam:LPARAM
LOCAL @varinat:VARIANT
local @stPs:PAINTSTRUCT
LOCAL @rect:RECT
LOCAL @x:REAL8 ;x轴比例因子
LOCAL @y:real8
local @width:qword ;某个控件的宽度
LOCAL @higth:qword
LOCAL @child_x:qword ;某个控件的x坐标
LOCAL @child_y:qword
mov rax uMsg
.if eax==WM_INITDIALOG
push hWin
pop hWnd
invoke GetWindowRect hWin addr org_main_rect
invoke ScreenToClient hWin addr org_main_rect.left
invoke ScreenToClient hWin addr org_main_rect.right
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
invoke GetDlgItem hWin 1002
mov rbx rax
invoke GetWindowRect rax addr INPUT_EDIT
invoke ScreenToClient hWin addr INPUT_EDIT.left ;指向窗口的句柄,此窗口的用户空间将被用来转换。
invoke ScreenToClient hWin addr INPUT_EDIT.right
invoke GetDlgItem hWin 1003
invoke GetWindowRect rax addr GoHome
invoke ScreenToClient hWin addr GoHome.left
invoke ScreenToClient hWin addr GoHome.right
invoke GetDlgItem hWin 1004
invoke GetWindowRect rax addr GoBack
invoke ScreenToClient hWin addr GoBack.left
invoke ScreenToClient hWin addr GoBack.right
invoke GetDlgItem hWin 1005
invoke GetWindowRect rax addr GoForward
invoke ScreenToClient hWin addr GoForward.left
invoke ScreenToClient hWin addr GoForward.right
invoke GetDlgItem hWin 1006
invoke GetWindowRect rax addr GoSTOP
invoke ScreenToClient hWin addr GoSTOP.left
invoke ScreenToClient hWin addr GoSTOP.right
invoke CreateThread 0 0 addr inter_explorer_thread hWnd 0 0
.elseif eax == WM_SIZE
.if pWB2 == 0
ret
.endif
invoke GetWindowRect hWin addr @rect
invoke ScreenToClient hWin addr @rect.left
invoke ScreenToClient hWin addr @rect.right
;求缩放的比例因子 (根据主窗口的变化)
finit ;初始浮点寄存器
mov eax @rect.left
sub @rect.right eax
mov eax @rect.top
sub @rect.bottom eax
fild @rect.right
fild org_main_rect.right
fsubp st(1) st (0)
fild org_main_rect.right
fdivp st(1) st (0)
fstp qword ptr @x
fild @rect.bottom
fild org_main_rect.bottom
fsubp st(1) st (0)
fild org_main_rect.bottom
fdivp st(1) st (0)
fstp qword ptr @y
; invoke GetDlgItem hWin 1001
; invoke GetClientRect rax addr org_main_rect
mov @varinat.vt VT_BOOL
mov @varinat.boolVal VARIANT_TRUE
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.put_Resizable] pWB2 addr @varinat
mov @varinat.vt VT_BOOL
mov @varinat.boolVal VARIANT_TRUE
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.put_StatusBar] pWB2 addr @varinat
invoke [rbx IWebBrowser2Vtbl.put_Left] pWB2 0
invoke [rbx IWebBrowser2Vtbl.put_Top] pWB2 0
mov eax @rect.right
invoke [rbx IWebBrowser2Vtbl.put_Width] pWB2 rax
mov eax @rect.bottom
invoke [rbx IWebBrowser2Vtbl.put_Height] pWB2 rax
mov esi @rect.right
mov edi @rect.bottom
; invoke MoveWindow _iOleClientSiteEx.inplace._frame.window 0 0 org_main_rect.right org_main_rect.bottom TRUE
invoke MoveWindow _iOleClientSiteEx.inplace._frame.window 0 0 rsi rdi TRUE
invoke movwindow hWin 1002 @x @y addr INPUT_EDIT
invoke movwindow hWin 1003 @x @y addr GoHome
invoke movwindow hWin 1004 @x @y addr GoBack
invoke movwindow hWin 1005 @x @y addr GoForward
invoke movwindow hWin 1006 @x @y addr GoSTOP
comment ~
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
fild org_main_rect.right
fld webbrowser_window.x
fmulp st (1) st (0)
fistp org_main_rect.left
fild org_main_rect.bottom
fld webbrowser_window.y
fmulp st (1) st (0)
fistp org_main_rect.top
fild org_main_rect.right
fld webbrowser_window._width
fmulp st (1) st (0)
fistp org_main_rect.right
fild org_main_rect.bottom
fld webbrowser_window.higth
fmulp st (1) st (0)
fistp org_main_rect.bottom
invoke GetDlgItem _hWin 1002
mov ebx eax
invoke MoveWindow ebx org_main_rect.left org_main_rect.top org_main_rect.right org_main_rect.bottom TRUE
mov @varinat.vt VT_BOOL
mov @varinat.boolVal VARIANT_TRUE
mov ebx pWB2
mov ebx [ebx]
invoke [ebx IWebBrowser2Vtbl.put_Resizable] pWB2 addr @varinat
invoke [ebx IWebBrowser2Vtbl.put_Left] pWB2 0
invoke [ebx IWebBrowser2Vtbl.put_Top] pWB2 0
mov eax org_main_rect.right
invoke [ebx IWebBrowser2Vtbl.put_Width] pWB2 eax
mov eax org_main_rect.bottom
invoke [ebx IWebBrowser2Vtbl.put_Height] pWB2 eax
invoke GetWindowRect _hWin addr org_main_rect
invoke ScreenToClient _hWin addr org_main_rect.left
invoke ScreenToClient _hWin addr org_main_rect.right
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
fild org_main_rect.right
fld viewnetaddress.x
fmulp st (1) st (0)
fistp org_main_rect.left
fild org_main_rect.bottom
fld viewnetaddress.y
fmulp st (1) st (0)
fistp org_main_rect.top
fild org_main_rect.right
fld viewnetaddress._width
fmulp st (1) st (0)
fistp org_main_rect.right
fild org_main_rect.bottom
fld viewnetaddress.higth
fmulp st (1) st (0)
fistp org_main_rect.bottom
invoke GetDlgItem _hWin 1005
mov ebx eax
invoke MoveWindow ebx org_main_rect.left org_main_rect.top org_main_rect.right org_main_rect.bottom TRUE
invoke GetWindowRect _hWin addr org_main_rect
invoke ScreenToClient _hWin addr org_main_rect.left
invoke ScreenToClient _hWin addr org_main_rect.right
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
fild org_main_rect.right
fld baiduzhuye.x
fmulp st (1) st (0)
fistp org_main_rect.left
fild org_main_rect.bottom
fld baiduzhuye.y
fmulp st (1) st (0)
fistp org_main_rect.top
fild org_main_rect.right
fld baiduzhuye._width
fmulp st (1) st (0)
fistp org_main_rect.right
fild org_main_rect.bottom
fld baiduzhuye.higth
fmulp st (1) st (0)
fistp org_main_rect.bottom
invoke GetDlgItem _hWin 1003
mov ebx eax
invoke MoveWindow ebx org_main_rect.left org_main_rect.top org_main_rect.right org_main_rect.bottom TRUE
invoke GetWindowRect _hWin addr org_main_rect
invoke ScreenToClient _hWin addr org_main_rect.left
invoke ScreenToClient _hWin addr org_main_rect.right
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
fild org_main_rect.right
fld tencentzhuye.x
fmulp st (1) st (0)
fistp org_main_rect.left
fild org_main_rect.bottom
fld tencentzhuye.y
fmulp st (1) st (0)
fistp org_main_rect.top
fild org_main_rect.right
fld tencentzhuye._width
fmulp st (1) st (0)
fistp org_main_rect.right
fild org_main_rect.bottom
fld tencentzhuye.higth
fmulp st (1) st (0)
fistp org_main_rect.bottom
invoke GetDlgItem _hWin 1001
mov ebx eax
invoke MoveWindow ebx org_main_rect.left org_main_rect.top org_main_rect.right org_main_rect.bottom TRUE
invoke GetWindowRect _hWin addr org_main_rect
invoke ScreenToClient _hWin addr org_main_rect.left
invoke ScreenToClient _hWin addr org_main_rect.right
mov eax org_main_rect.left
sub org_main_rect.right eax
mov eax org_main_rect.top
sub org_main_rect.bottom eax
fild org_main_rect.right
fld youselfzhuye.x
fmulp st (1) st (0)
fistp org_main_rect.left
fild org_main_rect.bottom
fld youselfzhuye.y
fmulp st (1) st (0)
fistp org_main_rect.top
fild org_main_rect.right
fld youselfzhuye._width
fmulp st (1) st (0)
fistp org_main_rect.right
fild org_main_rect.bottom
fld youselfzhuye.higth
fmulp st (1) st (0)
fistp org_main_rect.bottom
invoke GetDlgItem _hWin 1004
mov ebx eax
invoke MoveWindow ebx org_main_rect.left org_main_rect.top org_main_rect.right org_main_rect.bottom TRUE
;;;;这里是字体的缩放,还没有实现
invoke GetDlgItem _hWin 1003
mov ebx eax
invoke GetWindowDC ebx
mov @hdc eax
INVOKE SelectObject @hdc hfont_10
invoke GetDlgItemText _hWin 1003 addr @tempbuffer sizeof @tempbuffer
mov esi eax
invoke GetTextExtentPoint32 @hdc addr @tempbuffer esi addr tagSIZE_buffer
invoke ReleaseDC ebx @hdc
comment ~
.elseif eax==WM_COMMAND
mov rax wParam
and rax 0FFFFh
.if rax==IDM_FILE_EXIT
invoke SendMessage hWin WM_CLOSE 0 0
.elseif rax==IDM_HELP_ABOUT
invoke ShellAbout hWin addr AppName addr AboutMsg NULL
.elseif eax == 1003
invoke GetDlgItemText hWin 1002 addr _1003buffer sizeof _1003buffer
invoke MultiByteToWideChar CP_ACP 0 addr _1003buffer -1 addr netbuffer sizeof netbuffer
lea rsi netbuffer
invoke SysAllocString addr netbuffer
mov hsysstring rax
mov _VARIANT_buffer.vt VT_BSTR
mov _VARIANT_buffer.pbstrVal rax
lea rax _VARIANT_buffer
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.Navigate2] pWB2 rax 0 0 0 0
invoke SysFreeString hsysstring
.elseif eax == 1004
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.GoBack] pWB2
.elseif eax == 1005
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.GoForward] pWB2
.elseif eax == 1006
mov rbx pWB2
mov rbx [rbx]
invoke [rbx IWebBrowser2Vtbl.Stop] pWB2
.endif
; .elseif eax==WM_SIZE
.elseif eax == WM_PAINT
invoke BeginPaint hWin addr @stPs
invoke EndPaint hWin addr @stPs
.elseif eax==WM_CLOSE
invoke SendMessage _iOleClientSiteEx.inplace._frame.window WM_CLOSE 0 0
invoke DestroyWindow hWin
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage NULL
.else
invoke DefWindowProc hWin uMsg wParam lParam
ret
.endif
xor rax rax
ret
WndProc endp
end