AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Embed an Internet Explorer control in your AHK Gui via COM
Goto page Previous  1, 2, 3 ... 19, 20, 21
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
YIessa
Guest





PostPosted: Mon Sep 14, 2009 3:05 pm    Post subject: Reply with quote

Code:
#NoEnv
#SingleInstance force
SendMode Input
SetBatchLines, -1
DetectHiddenWindows, On

  IE_Init()

  Gui, +Resize +LastFound
  Gui, Show, w800 h600 Center, Test
  hGui:= WinExist()
  pwb := IE_Add(hGui, 10, 10, 780, 580)

  pipa := COM_QueryInterface(pwb, IOleInPlaceActiveObject_Interface)
  OnMessage(WM_KEYUP:=0x0101, "WM_KEYDOWN")
  OnMessage(WM_KEYDOWN:=0x0100, "WM_KEYDOWN")

  IE_LoadURL(pwb, "http://www.google.com/")
return

GuiClose:
  Gui, Destroy
  COM_Release(pwb)
  IE_Term()
  ExitApp
return

#include inc\COM.ahk
#include inc\IE.ahk

WM_KEYDOWN(wParam, lParam, nMsg, hWnd)
{
;   If   (wParam = 0x08 || wParam = 0x09 || wParam = 0x0D || wParam = 0x26 || wParam = 0x28 || wParam = 0x2E || wParam = 0x43 || wParam = 0x56 || wParam = 0x58)
   WinGetClass, Class, ahk_id %hWnd%
   If   (Class = "Internet Explorer_Server")
   {
      Global pipa
      VarSetCapacity(Msg, 28), NumPut(hWnd,Msg), NumPut(nMsg,Msg,4), NumPut(wParam,Msg,8), NumPut(lParam,Msg,12), NumPut(A_EventInfo,Msg,16), NumPut(A_GuiX,Msg,20), NumPut(A_GuiY,Msg,24)
      If DllCall(NumGet(NumGet(1*pipa)+20), "Uint", pipa, "Uint", &Msg)=0
      Return   0
   }
}
Back to top
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Tue Sep 15, 2009 6:48 am    Post subject: Reply with quote

It's missing the assignment of IOleInPlaceActiveObject_Interface.
Back to top
View user's profile Send private message
YIessa
Guest





PostPosted: Tue Sep 15, 2009 10:56 am    Post subject: Reply with quote

I have found this in the forum "IE and Gui Browser Com Tutorial" :

Code:
  IOleInPlaceActiveObject_Interface:="{00000117-0000-0000-C000-000000000046}"


and it works.

Thanks a lot !!
Back to top
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue Sep 15, 2009 12:11 pm    Post subject: Reply with quote

funny that i didnt spot that rightoff
perhapsif i put this crack pipe down
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
YIessa
Guest





PostPosted: Tue Sep 15, 2009 12:35 pm    Post subject: Thanks Reply with quote

Thanks a lot tank and Sean for your help and great job
Back to top
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue Sep 15, 2009 1:10 pm    Post subject: Re: Thanks Reply with quote

YIessa wrote:
Thanks a lot tank and Sean for your help and great job
thank sean without him none of this is even possible
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
AHK User
Guest





PostPosted: Thu Jan 07, 2010 3:38 pm    Post subject: Reply with quote

sorry do not know what i iam making false but always i will handle with the IEControl.ahk he gives me this error.

http://img98.imageshack.us/img98/8953/errortl.png
Back to top
מא&am
Guest





PostPosted: Mon Jul 26, 2010 12:43 pm    Post subject: Reply with quote

Sean wrote:
1 means that the message was not processed, i.e., ignored by the webpage. What happens if using iexplore.exe? Which version of IE are you using?
Back to top
sp



Joined: 07 May 2011
Posts: 52

PostPosted: Thu May 19, 2011 5:22 pm    Post subject: how to embed Internet Explorer and insert some HTML in it. Reply with quote

Hello.

How can I do the following in AutoHotKey_L ?

Code:
#include IEControl.ahk
Gui, +lastfound
Gui1_Hwnd := WinExist() , html_string := "<body bgcolor=88888><center> <font size=5>HTML
                                         <font color=FF0000 ><u>live</u></font><i> preview!!</i>
                                         </font></center><br>`n"

Gui, Add, Edit, w700 h150   vhtml_string  gSub_html_string, %html_string%
Gui_IEAdd(Gui1_Hwnd, 10, 160, 700, 325, "about:" . html_string)
Gui, Show, h500, HTML Live...
Return

Sub_html_string:
GuiControlGet, html_string
Gui_IELoadURL( "about:" . html_string)
Return

Guiescape:
Guiclose:
ExitApp
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 19, 20, 21
Page 21 of 21

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group