AutoHotkey Community

It is currently May 26th, 2012, 4:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 309 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 21  Next
Author Message
 Post subject:
PostPosted: January 25th, 2008, 8:36 pm 
Offline

Joined: January 19th, 2007, 9:09 pm
Posts: 147
tank wrote:
i mean it i really am a villiage idiot
but wow dude read the freaking manual even wtf i did of course :S
Quote:
After creating a Tab control, subsequently added controls automatically belong to its first tab. This can be changed at any time by following these examples:

Gui, Tab ; Future controls are not part of any tab control.
Gui, Tab, 3 ; Future controls are owned by the third tab of the current tab control.
Gui, Tab, 3, 2 ; Future controls are owned by the third tab of the second tab control.
Gui, Tab, Name ; Future controls are owned by the tab whose name starts with Name (not case sensitive).
Gui, Tab, Name,, Exact ; Same as above but requires exact match (case sensitive too).

straight out of the freaking help file for tabs
so your problem is this
Code:

#Include IE.ahk

Gui, Add, Tab2, w1000 h1000, Tab1|Tab2|Tab3
Gui, Tab, 1
Gosub, GuiOpen
Gui, +Resize +LastFound
Gui, Show, Autosize Center, Fusion 0.1a

hGui:= WinExist()
pwb := IE_Add(hGui, +20, 30, 780, 580)
IE_LoadURL(pwb, "http://nuclearfamily.soft.nl/")

GuiOpen:
IE_Init()
Return

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


But this isn't working also :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 8:49 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
here is a quick example.....i can post a better one later sometime.....
Code:
#Include IEControl.ahk ; + CoHelper.ahk!
OnExit, WebTerminate
SetTitleMatchMode, 2

W := A_ScreenWidth-100
H := A_ScreenHeight-100
WinTitle = TabTest

GUI:
   Gui +0x2000000 +Lastfound
   Gui Margin, 0, 0
   Gui, Add, Tab, h25 w%W% gMyTab vSelTab, IE1|IE2
   Gui, Show, h%H% w%W%, %WinTitle%
   GoSub, WebInit
   Return
   
WebInit:
   GoSub, GuiStart
   pwb1 := IE_Add(WinExist(), 0, 25, w, h - 25)
   pwb2 := IE_Add(WinExist(), 0, 25, w, h - 25)
   OldhWnd := IE1 := GetHostWindow(pwb1)
   IE2 := GetHostWindow(pwb2)
   IE_LoadURL(pwb1, "http://www.google.com")
   IE_LoadURL(pwb2, "http://www.yahoo.com")
   WinHide, ahk_id %IE2%
   
   GuiStart:
      AtlAxWinInit()
      CoInitialize()
      Return
   Return
MyTab:
Gui, Submit, NoHide
WinHide, % "ahk_id " .  OldhWnd
WinShow, % "ahk_id " .  %SelTab%
OldhWnd := %SelTab%
   return
   
   
GuiClose:
WebTerminate:
Gui, Destroy
      Release(pwb)
      CoUninitialize()
      AtlAxWinTerm()
      ExitApp

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 8:52 pm 
Offline

Joined: January 19th, 2007, 9:09 pm
Posts: 147
Wow thanks :D
Oh and here is the rewritten version for IE.ahk, maybe some people wants it:

Code:
#Include IE.ahk
OnExit, WebTerminate
SetTitleMatchMode, 2

W := A_ScreenWidth-100
H := A_ScreenHeight-100
WinTitle = TabTest

GUI:
   Gui +0x2000000 +Lastfound
   Gui Margin, 0, 0
   Gui, Add, Tab, h25 w%W% gMyTab vSelTab, IE1|IE2
   Gui, Show, h%H% w%W%, %WinTitle%
   GoSub, WebInit
   Return
   
WebInit:
   GoSub, GuiStart
   pwb1 := IE_Add(WinExist(), 0, 25, w, h - 25)
   IE_LoadURL(pwb1, "http://www.google.com")
   GuiStart:
   IE_Init()
      Return
   Return
MyTab:
Gui, Submit, NoHide
WinHide, % "ahk_id " .  OldhWnd
WinShow, % "ahk_id " .  %SelTab%
OldhWnd := %SelTab%
   return
   
   
GuiClose:
WebTerminate:
Gui, Destroy
COM_Release(pwb)
IE_Term()
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 8:53 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
tank wrote:
Ok so far i havent found a way via any AHK to access the DOM
But as i work with DOM
Ill offer soemthing I got this elsewhere in the forums in various places i dont recall it being all put together this way. as an entire post

Code:
#Include acc.ahk
#Include com.ahk
IE_InjectJS(hWnd_MainWindow, JS_to_Inject, VarNames_to_Return="")
   {
   ;Get a list of the hWnd's owned by the window specified
   WinGet, ActiveControlList, ControlListhWnd, ahk_id %hWnd_MainWindow%
   ;Go throught the list 1 at a time to determine if it is the correct control
   ;This will allow the script to find the current tab in IE7
   Loop, Parse, ActiveControlList, `n
      {
      ;Get the classname of the current control
      WinGetClass, ThisWinClass, ahk_id %A_LoopField%
      ;If the classname is correct and it is visible, it is the correct tab
      If (ThisWinClass = "Internet Explorer_Server") and (DllCall("IsWindowVisible", UInt, A_LoopField))
       hIESvr := A_LoopField
      }
   ;If a control was not found, give a message and return, doing nothing   
   If !hIESvr
      {
      MsgBox, Control "Internet Explorer_Server" not found.
      Return
      }
   ;Initialize the COM interface. code modified from SEAN
   IID_IHTMLWindow2   := "{332C4427-26CB-11D0-B483-00C04FD90119}"
   ACC_Init()
   pacc := ACC_AccessibleObjectFromWindow(hIESvr)
   pwin := COM_QueryService(pacc,IID_IHTMLWindow2,IID_IHTMLWindow2)
   COM_Release(pacc)
   ;Execute the Javascript (if there is any). Thanks LEXIKOS.
   If JS_to_Inject
      COM_Invoke(pwin, "execscript", JS_to_Inject)
   ;Get the value of the variables, if any.
   If VarNames_to_Return {
      ;Split the passed variable names into a psuedo array of ahk variables
      StringSplit, Vars_, VarNames_to_Return, `,
      ;Get the value of each javascript variable in the order it was passed
      Loop, %Vars_0%
         Ret .= COM_Invoke(pwin,Vars_%A_Index%) . ","
      ;Remove the trailing comma
      StringTrimRight, Ret, Ret, 1
      }
   ; Cleanup
   COM_Release(pwin)
   ACC_Term()
   ;Return a comma seperated list of variables in the order they were passed
   Return Ret
   }



And usage would be like this
Code:
AHKvar:=IE_InjectJS(WinExist("wintitle"), "javascript:var x=document.getElementsByTagName(""td"");var jsvar=x[0].innerHTML;","jsvar")
msgbox % AHKvar


basically any javascripting that can be saved in one line can be executed this way on any window



That is my code.
http://www.autohotkey.com/forum/viewtopic.php?t=25473
I am going to stop posting on the forum too, i think.
:evil:

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2008, 11:25 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
Hey ahklerner
Im sorry, if you read that i said in that post i found else where and i couldnt remember where later when someone told me who it was i geve the kudo's
I just tagged it in in a related post
man Im sorry ill post anywhere you want each time i talk about it now i post that its your work
tell me how i can atone with you on this and ill do it
i wasnt trying to steal anything from you
in short please accept the apology of a villiage idiot if i have offended you in any way

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2008, 12:01 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
its ok....lots of people are starting to do it lately, though....just is kind of annoying.

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2008, 7:02 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
really its not ok but i appreciate your politeness
it was very wrong of me

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2008, 9:39 pm 
Offline

Joined: January 19th, 2007, 9:09 pm
Posts: 147
I have another problem with it... :(
I have 2 (and later more) gui windows, the 'main' window, with tabs, and some other windows like properties etc.
In the main window, I want to embed an ie control, but I can't get it working :S
Someone knows how I can do this?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2008, 9:10 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Dear daonlyfreez, :)

Re: Your post : http://www.autohotkey.com/forum/viewtop ... 004#108004 at the very beginning of this topic.

Redundant quote removed.

Can you please show me how to include a web control based on Mozilla ActiveX ?
I have already installed Mozilla ActiveX Control and have been reading through various topics but could not find any working code.

My requirement is very simple: I pass a url to the script and I get a full sized control displaying the contents - no buttons or any other controls required!.
And so, I would like it to run without any dependent wrapper.

Please help.

Regards, :)


Last edited by SKAN on February 21st, 2008, 9:14 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2008, 10:29 pm 
Offline

Joined: July 23rd, 2007, 3:43 am
Posts: 47
Sean wrote:
Quote:
One somewhat major problem I'm experiencing using the latest CoHelper.ahk and this new IE4AHK COM code is that the main scroll bar doesn't appear, and you can't use pageup/pagedown/arrowup/arrowdown to move arround inside the page.

I think this part is easy to correct. I updated the script. The only change is:

Code:
, "Uint", 0x10000000 | 0x40000000 | 0x04200000   ; WS_VISIBLE | WS_CHILD | ...

Is there a easy way to remove the scrollbar if you don't want it? I thought I saw a post for this a long time ago, but cannot seem to find it anywhere in this topic!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2008, 1:49 pm 
daniel2 wrote:
Code:
, "Uint", 0x10000000 | 0x40000000 | 0x04200000   ; WS_VISIBLE | WS_CHILD | ...

Is there a easy way to remove the scrollbar if you don't want it? I thought I saw a post for this a long time ago, but cannot seem to find it anywhere in this topic![/quote]
WS_VSCROLL is 0x00200000 (WS_HSCROLL is 0x00100000). So, you can replace 0x04200000 with 0x04000000 if you don't want the scrollbar.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2008, 1:53 pm 
SKAN wrote:
My requirement is very simple: I pass a url to the script and I get a full sized control displaying the contents - no buttons or any other controls required!.

You may replace "Shell.Explorer" with "Mozilla.Browser" in all of the examples, like:
Code:
COM_AtlAxCreateContainer(hWnd, 0, 0, 800, 600, "Mozilla.Browser")


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2008, 9:16 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Anonymous wrote:
You may replace "Shell.Explorer" with "Mozilla.Browser" in all of the examples


Thanks! I wanted to avoid the wrapper, but this is an useful hint.

:)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 16th, 2008, 5:43 pm 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
firstly, i don't know how to use COM
but i found this neat module(?) which makes everyone can put IE in gui
it shows well. but i'm having some weird problem.

what i am trying to do is putting chat room in gui using gabbly.com

1) embed IE into gui
2) embed gabbly.com chat wizet into embeded IE in gui
3) it works!
4) but the {Enter} key doesn't working in embeded IE
i can't even send a word, i can't communicate :<

i've tested with all kind of these web based chat module
and nothing works in embeded IE
hope someone could solve it

below are my simple codes
Code:
<body leftmargin='0' topmargin='0'>
<iframe src='http://cw.gabbly.com/gabbly/cw.jsp?e=1&t=blank&pw=0&priv=on' scrolling='no' style='width:100%; height:100%' frameborder='0'></iframe>

gabbly.html in local

Code:
#Include IE.ahk
OnExit, WebTerminate
SetTitleMatchMode, 2

GUI:
   Gui +0x2000000 +Lastfound
   Gui Margin, 0, 0
   Gui, Show, Center w640 h480, Gabbly Test
   GoSub, WebInit
   Return
   
WebInit:
Gosub, GuiStart
   pwb1 := IE_Add(WinExist(), 0, 0, 640, 480 - 25)
   IE_LoadURL(pwb1, "gabbly.html")
GuiStart:
   IE_Init()
Return
Return
   
GuiClose:
WebTerminate:
Gui, Destroy
COM_Release(pwb)
IE_Term()
ExitApp

pulling gabbly.html from local then it shows gabbly chat room
but the {Enter} key doesn't works....


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 19th, 2008, 9:13 pm 
Offline

Joined: September 21st, 2006, 10:04 pm
Posts: 32
heresy wrote:
4) but the {Enter} key doesn't working in embeded IE
i can't even send a word, i can't communicate :<

The failure of {tab} and {enter} keys (among others) to work as expected is a known problem for WebBrowser controls that are hosted within ATL or MFC applications. The outer GUI (within which the internet explorer window is embedded) has the focus for these keystrokes. See, for example:While googling, I found bits and pieces of C and VB code about that solve this (intercepting the keystrokes passed to the parent window and passing them back to the WebBrowser control using TranslateAccelerator). But I'm unaware of anyone who's solved this problem in AHK.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 309 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 21  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: JamixZol, Yahoo [Bot] and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group