flat assembler
Message board for the users of flat assembler.

Index > Windows > HTA features implemented with tricks into ur win32 :)

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
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 Smile

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


Code:
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 Confused
                       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'
    
Post 17 Dec 2004, 16:52
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
forget to supply the sample hta file


Description: sample hta file for testing purpose
Download
Filename: test.rar
Filesize: 400 Bytes
Downloaded: 96 Time(s)

Post 17 Dec 2004, 16:53
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
very nice - you have some issues with redrawing but I get the point Wink
Post 21 Dec 2004, 23:21
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger 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 GitHub, YouTube, Twitter.

Website powered by rwasa.