Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

COM Object Reference [AutoHotkey v1.1+]


  • Please log in to reply
233 replies to this topic
dumpster.monkey
  • Members
  • 12 posts
  • Last active: Sep 25 2011 12:59 PM
  • Joined: 30 Jul 2011

COM_Invoke(psf, "Scale=", "exactfit")
psf.Scale := "exactfit"


thanks, but I get: unknown name, specifically "scale"

Think I'll have to wrap in html, similar to what you've done in aaron's youtube television

dumpster.monkey
  • Members
  • 12 posts
  • Last active: Sep 25 2011 12:59 PM
  • Joined: 30 Jul 2011
You pointed me in the right direction - it was my bad using the guid.
And instead of navigate I should have used movie.

Code ends up like so:

#SingleInstance force 

w = 530
h = 336

Gui, 1: +LastFound -Caption +AlwaysOnTop -SysMenu 
Gui, 1: Show, w%w% h%h% Center, Flash 
Gui, 1: Margin, 0 ,0
Gui, 1: Add, ActiveX, w%w% h%h% vpwb, ShockwaveFlash.ShockwaveFlash
getSwfFromDisk = %A_ScriptDir%/HyperFPLaunch/hiScores_0.swf
pwb.Movie := "file:///" . getSwfFromDisk
pwb.Scale := "exactfit"
Return 

GuiClose: 
  Esc::
  Gui, 1:Destroy 
  ExitApp 
Return

Cheers Nimda :)

ScripterZ
  • Members
  • 49 posts
  • Last active: Feb 20 2012 10:23 AM
  • Joined: 28 Sep 2011
So, 2 questions:
1) If the embedded media player uses a function from a library that's part of AHK_L, why isn't it working?
2) How can I make the media player play more than 1 file at a time?
To-do list:
1) Add signature.
2) Stop procrastinating.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
what's it?

ScripterZ
  • Members
  • 49 posts
  • Last active: Feb 20 2012 10:23 AM
  • Joined: 28 Sep 2011

So, 2 questions:
1) If the embedded media player uses a function from a library that's part of AHK_L, why isn't it working?
2) How can I make the media player play more than 1 file at a time?

what's it?

:?:
To-do list:
1) Add signature.
2) Stop procrastinating.

aRt)Y
  • Members
  • 447 posts
  • Last active: Oct 03 2013 08:40 PM
  • Joined: 17 Nov 2011

So, 2 questions:
1) If the embedded media player uses a function from a library that's part of AHK_L, why isn't it working?
2) How can I make the media player play more than 1 file at a time?

what's it?

:?:

Could be the underlined part.

ScripterZ
  • Members
  • 49 posts
  • Last active: Feb 20 2012 10:23 AM
  • Joined: 28 Sep 2011

So, 2 questions:
1) If the embedded media player uses a function from a library that's part of AHK_L, why isn't it working?
2) How can I make the media player play more than 1 file at a time?

what's it?

:?:

Could be the underlined part.

If the library is part of AHK now, shouldn't it work now? Or does it use a new command?
To-do list:
1) Add signature.
2) Stop procrastinating.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
What library - and what's not working?

ScripterZ
  • Members
  • 49 posts
  • Last active: Feb 20 2012 10:23 AM
  • Joined: 28 Sep 2011
Sorry, didn't realize it wasn't the first post.
FileSelectFile, file, 2, %A_MyDocuments%, Select WMP Compatable File:
if Errorlevel
   ExitApp

Gui, +LastFound +Resize
wmp := Atl_AxCreateControl(WinExist(), "WMPlayer.OCX") <- this
wmp.URL := file
Gui, Show, w300 h300 Center, Player GUI
return

GuiClose:
   Gui, Destroy
   ExitApp
Anyway, the line shown (bbcode doesn't work in code) part gives an error when using just AHK_L. However, when using the Atl.ahk library, it works fine. Does ahkL use another command for that?
Also, is there a way to make it play more than 1 file? (Just editing Fileselectfile to allow multiple files isn't enough apparently.)
I really like the media player, but it would be nice if I could play more than 1 file at a time.
To-do list:
1) Add signature.
2) Stop procrastinating.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Thanks for pointing it out - I updated the example.

I really like your media player, but it would be nice if I could play more than 1 file at a time.

It's not my media player - it simply uses the WMP ActiveX control. Also, it wasn't designed to be an example of an all-out media player - it's just a simple demonstration of how to embed the ActiveX control in a GUI.

alethia
  • Guests
  • Last active:
  • Joined: --
So I have some code to create a connection to a SQL Server DB and import a table into excel. My AHK Script does this as follows once an excel file/workbook is open/active/visible...

; Create DB Connection
send {ALT}
sleep 100
send A
sleep 100
send F+O
sleep 100
send {ENTER}
sleep 100

The script then goes on to create the connection by moving through various prompts and sending the server info etc... I can post that code if needed.

I have been modifying this script after seeing these COM so that AHK will do these actions without the excel file being shown. From this thread and others I have started with the following...

; Com code to activate an excel object and workbook without displaying it
oExcel := ComObjCreate("Excel.Application") ; create Excel Application object 
oExcel.Workbooks.Add   ; create a new workbook
oExcel.ActiveWorkbook.SaveAs(FileName) ; save the excel work book

I am stuck at the next spot which is creating the SQL Server connection using the COM commands for the excel workbook.

I suspect I need to use the following, but I'm not sure how to procede...

oExcel.ActiveWorkbook.SaveAsODC(ODBCFileName, "Connection Description, ODBCConnectionString, ?) ; save the ODBC connection as a Microsoft Office Data Connection file

Has anyone tried this? Can anyone point me in the correct direction?

Thanks all

Talamasca
  • Members
  • 5 posts
  • Last active: Mar 10 2012 05:38 PM
  • Joined: 20 Feb 2012
Hello!
Great Code to make access to word!
but...
but...

oWord.Selection.TypeText %Var%

it´s not working!

your example contains live-Strings, this IS working...
Do you please have ´n idea`!


(I dont want to use ...send...)
____________________________________________________________
oWord.Selection.TypeText("Visit ") ; type text

oWord.ActiveDocument.Hyperlinks.Add(oWord.Selection.Range, "http://www.autohotkey.com/forum/topic61509.html"
,"","","COM Object Reference [AutoHotkey_L]") ; insert hyperlink
oWord.Selection.TypeText("and learn how to work with ") ; type text

oWord.Selection.TypeText("COM objects") ; type text

oWord.Selection.TypeText(".") ; type text
oWord.Selection.TypeParagraph ; type paragraph (enter, new line)

nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010

oWord.Selection.TypeText %Var%

you need to use an Expression.
oWord.Selection.TypeText(Var)


Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Excel post updated with some additional info.

0x150--ISO
  • Members
  • 657 posts
  • Last active: Apr 07 2012 09:06 PM
  • Joined: 01 Jan 2011
Taken from: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?p=416917#p416917">viewtopic.php?p=416917#p416917</a><!-- l -->

Every one asks why ctrl+key comboes and enter do not work in theier implementation of this.

Could it be fair to assume other aspects of a page may not work properly like layout and or other 3rd party objects?