hi,
i have a small idea which i guess, if implemented, could save us a lot of problems and provide very rich features.
the idea is like this.
i guess many of us know about the HTA (HTML Application)
my idea is to bring the HTA feature into application using the moving window technique.
so, we save the implementation of using the webbrowser control or watsoever.
but our application would be HTML compatible
i've been succesfully moving the window (with the aid of mouse hook tutorial) to get the window handle number (manually)
and move it, the problem i have is how to get the "HTML Application Host Window Class" handle automatically.
i tried FindWindow and ... but didn't success.
i am thinking about creating a new window using the class name "HTML ..." but i find that the information on using the HTA is quite scarce on the internet
format PE GUI 4.0
include '%fasminc%\win32a.inc'
entry start
section '.data' data readable writeable
wndClsName db 'TRICKS',0
wndTitle db 'Nice Tricks',0
insH dd ?
wndH dd ?
wndCls WNDCLASS
wndMsg MSG
progName db 'c:\windows\system\mshta.exe',0
progParam db ' h:\win32\test.hta',0 ;<- change it to ur example dot hta file
progStartupInfo STARTUPINFO
progClsName db 'HTML Application Host Window Class',0
progTitle db 'NICE TRICKS',0
proInfo PROCESS_INFORMATION
wndInfo WINDOWINFO
buf rb 0xFF
f1 db '%X',0
f2 db '%s',0
section '.code' code readable executable
start:
invoke GetModuleHandle,NULL
mov [insH],eax
mov [wndCls.hInstance],eax
mov [wndCls.style],CS_HREDRAW + CS_VREDRAW
mov [wndCls.lpfnWndProc],proc_window
invoke LoadIcon,NULL,IDI_APPLICATION
mov [wndCls.hIcon],eax
invoke LoadCursor,NULL,IDC_ARROW
mov [wndCls.hCursor],eax
mov [wndCls.hbrBackground],COLOR_BTNFACE + 1
mov [wndCls.lpszClassName],wndClsName
invoke RegisterClass,wndCls
invoke CreateWindowEx,NULL,wndClsName,wndTitle,\
WS_OVERLAPPEDWINDOW + WS_VISIBLE,\
CW_USEDEFAULT,CW_USEDEFAULT,500,400,\
NULL,NULL,[insH],NULL
mov [wndH],eax
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 ExitProcess,0
proc proc_window,hWnd,uMsg,wParam,lParam
push ebx esi edi
cmp [uMsg],WM_CREATE
je .wmCREATE
cmp [uMsg],WM_CLOSE
je .wmCLOSE
cmp [uMsg],WM_DESTROY
je .wmDESTROY
.wmDEFAULT:
invoke DefWindowProc,[hWnd],[uMsg],[wParam],[lParam]
jmp .wmBYE
.wmCREATE:
invoke GetStartupInfo,progStartupInfo
invoke CreateProcess,progName,progParam,NULL,NULL,FALSE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,progStartupInfo,proInfo
;how to get the handle of this process
jmp .wmBYE
.wmCLOSE:
invoke DestroyWindow,[hWnd]
jmp .wmBYE
.wmDESTROY:
invoke PostQuitMessage,0
.wmBYE:
pop edi esi ebx
return
endp
section '.idata' import data readable
library kernel32,'KERNEL32.DLL',\
user32, 'USER32.DLL'
include '%fasminc%\apia\Kernel32.inc'
include '%fasminc%\apia\User32.inc'