设置IE7选项卡 最前端(200分)

  • 主题发起人 主题发起人 zzutrain
  • 开始时间 开始时间
Z

zzutrain

Unregistered / Unconfirmed
GUEST, unregistred user!
使用IE7.0, 打开了多个选项卡, 我想编程实现 某个选项卡 到最前端, 如何实现?
 
SendMessage()
 
有源码的..
 
哪里有源码
 
uses DDEman, SHDocVw, mshtml, ActiveX

function CheckUrlIsOpend(url:String):Boolean;
var
ShellWindow: IShellWindows;
spDisp: IDispatch;
i: integer;
vi: OleVariant;
IE1 ,IEwnd: IWebBrowser2;
//Doc: IHTMLDocument2;
TabHWND: HWND;
//DocHWND: HWND;

szTitle:Array[0..MAX_PATH] of char;

function IeFromObj(Wnd: HWND; var Instance: IWebBrowser2): HRESULT;
type
TObjectFromLResult=function(Res: LRESULT; const IID: TGUID; Param: WPARAM; out pObject): HRESULT; stdcall;
var
Lib: HINST;
Msg: integer;
hnd: HWND;
Res: cardinal;
ObjectFromLResult: TObjectFromLResult;
Doc: IHTMLDocument2;
begin
Result:=0;
Lib:=LoadLibrary('Oleacc.dll');
@ObjectFromLResult:=GetProcAddress(Lib,'ObjectFromLresult');
if (@ObjectFromLResult<>nil) then begin
try
Msg:=RegisterWindowMessage('WM_HTML_GETOBJECT');
hnd:=FindWindowEx(Wnd,0,'Shell DocObject View',nil);
if hnd<>0 then hnd:=FindWindowEx(hnd, 0, 'Internet Explorer_Server', nil);
SendMessageTimeout(hnd,Msg,0,0,SMTO_ABORTIFHUNG,1000,Res);
Result:=ObjectFromLResult(Res,IHTMLDocument2,0,Doc);
if (Result=S_OK) then begin
(Doc.parentWindow as IServiceProvider).QueryService(IWebBrowserApp,IWebBrowser2,Instance);
end;
finally
FreeLibrary(Lib);
end;
end;
end;

begin
Result:=False;
ShellWindow:=CoShellWindows.Create;
for i:=0 to ShellWindow.Count-1 do begin
vi:= i;
spDisp:=ShellWindow.Item(vi);
spDisp.QueryInterface(IWebBrowser2, IE1);
if Assigned(IE1) then begin
if IE1.LocationURL=url then begin
//激活窗口
{// 获取所有 IE 窗口的 HWND
TabHWND:=0;
while (true) do begin
DocHWND:=FindWindowEx(IE1.HWND,TabHWND,'TabWindowClass',nil);
if (DocHWND=0) then break;
GetWindowText(DocHWND,@szTitle,SizeOf(szTitle));
showmessage(szTitle);
TabHWND:=DocHWND;
end;
//}
//{//
if StrToInt(GetIexploreFileVersion(IE1.FullName)[1])>=7 then begin
TabHWND:=GetWindow(IE1.HWND, GW_CHILD);
while(TabHWND >0 ) do begin
GetClassName(TabHWND, @szTitle, SizeOf(szTitle));
if (StrPas(szTitle)='TabWindowClass') then begin
//由TabWindowClass 的 HWND 获取 IHtmlDocument2 得到 窗口 address
{// The Active IOleWindow
if IsWindowEnabled(TabHWND) then begin
GetWindowText(TabHWND,@szTitle,SizeOf(szTitle));
Showmessage(szTitle);
end;
//}
IeFromObj(TabHWND,IEwnd);
if Assigned(IEwnd) then begin
if IEwnd.LocationURL=IE1.LocationURL then begin //找到对应URL 的选项卡
//对应选项卡置前 [red]问题: 如何置前[/red]
Break;
end;
end;
end;
TabHWND:= GetNextWindow(TabHWND, GW_HWNDNEXT);
end;
//TabHWND:=FindWindowEX(IE1.HWND, 0, 'TabWindowClass',nil);
//DocHWND:=FindWindowEX(TabHWND,0, 'Shell DocObject View',nil);
//if DocHWND<>0 then DocHWND:=FindWindowEx(DocHWND, 0, 'Internet Explorer_Server', nil); //当前活动窗口
//SendMessage(DocHWND, WM_COMMAND, 2139, 0); //查看源文件
end;
//}
SetForegroundWindow(IE1.HWND);
BringWindowToTop(IE1.HWND);
ShowWindow(IE1.HWND,SW_SHOWMAXIMIZED);
Windows.SetFocus(IE1.HWND);
//
Result:=True;
Break;
end;
end;
end;
end;
 
学习,,学习..
 
我已经解决了,把结果贴出来, 共享
GetIexploreFileVersion 获得IE文件版本
CheckUrlIsOpend 检查url是否已经打开, openclose 表示, 是关闭还是打开IE窗口

function TfCliTray.GetIexploreFileVersion(FileName: String; bIncludeBuild: boolean=False):String;
var
dwfvw, dwZero, dwvsf: DWORD;
Major, Minor, Release, Build: DWORD;
pfvw: PChar;
pvsf: PVSFixedFileInfo;
s: string;
begin
Result:='';
dwfvw:=GetFileVersionInfoSize(PChar(FileName), dwZero);
if dwfvw<>0 then begin
GetMem(pfvw, dwfvw);
try
if(GetFileVersionInfo(PChar(FileName), dwZero, dwfvw, pfvw))then begin
if(VerQueryValue(pfvw, '/', Pointer(pvsf), dwvsf))then begin
if((pvsf^.dwFileFlags and VS_FF_PRERELEASE)>0)then begin
s:='beta';
end else begin
s:='';
end;
Major:=HIWORD(pvsf^.dwFileVersionMS);
Minor:=LOWORD(pvsf^.dwFileVersionMS);
Release:=HIWORD(pvsf^.dwFileVersionLS);
Build:=LOWORD(pvsf^.dwFileVersionLS);
Result:=Format('%d.%d.%d.%d', [Major, Minor, Release, Build]);
if bIncludeBuild then begin
if Release>0 then begin
Result:=Format('%d.%d.%d.%d', [Major, Minor, Release, Build])
end else begin
Result:=Format('%d.%d.%d', [Major, Minor, Build])
end;
end else begin
if Release>0 then begin
Result:=Format('%d.%d.%d', [Major, Minor, Release])
end else begin
Result:=Format('%d.%d', [Major, Minor])
end;
end;
end;
end;
finally
FreeMem(pfvw);
end;
end;
end;

function TfCliTray.CheckUrlIsOpend(url:String; OpenClose: Boolean):Boolean;
var
ShellWindow: IShellWindows;
spDisp: IDispatch;
i : integer;
vi: OleVariant;
IE1: IWebBrowser2;
HTML1: IHTMLDocument2;
IEIC1: IHTMLElementCollection;
IESP: IDispatch;
HtmlInputEle : IHTMLInputElement;
FrameHWND: HWND;
ExitFor: Boolean;
//{//

//TabHWND: HWND;
//hRes: HRESULT;
//{//
UIHWND: HWND;
AccParent,AccChild,acctab: IAccessible;
j, TabsCount,TabsReceived:Integer;
ChildStruct: array of OleVARIANT;
tabDisp: IDispatch;
tabCaption: WideString;
//}


function GetServerPageDir(Surl:String):String;
var
L,tl:Integer;
begin
Result:=Surl;
L:=0;
if Pos('http://', LowerCase(Result)) > 0 then begin
System.Delete(Result, 1, Length('http://'));
L:=L+Length('http://');
end;
tl:=Pos('/',Result);
while tl>0 do begin
L:=L+tl;
System.Delete(Result,1,tl);
tl:=Pos('/',Result);
end;
Result :=Copy(Surl, 1, L);
end;

function FindIETabControlDisp(varaccParent: IAccessible;out PTabsDisp: IAccessible):Boolean;
var
x,tabsnum,tabsrec:Integer;
tmpdisp: IDispatch;
disprole: OleVariant;
tabstru: array of OleVariant;
begin
Result:=False;
if varaccParent.get_accChildCount(tabsnum)=S_OK then begin
SetLength(tabstru, tabsnum);
try
if AccessibleChildren(Pointer(varaccParent),0,tabsnum,tabstru[0],tabsrec)=S_OK then begin
for x:=0 to tabsrec-1 do begin
case VarType(tabstru[x]) of
varInteger: varaccParent.Get_accChild(tabstru[x], tmpdisp);
varDispatch: tmpdisp := tabstru[x];
end;
if Assigned(tmpdisp) and (tmpdisp.QueryInterface(IAccessible, PTabsDisp) = S_OK) then begin
PTabsDisp.Get_accRole(CHILDID_SELF,disprole);
Result:=(VarType(disprole)=varInteger) and (disprole=ROLE_SYSTEM_PAGETABLIST);
if Result then Break;
end;
end;
end;
finally
SetLength(tabstru, 0);
end;
end;
end;


function IeBrowserFromObj(Wnd: HWND; var Instance: IWebBrowser2): HRESULT;
var
Msg: integer;
hnd: HWND;
Res: cardinal;
Doc: IHTMLDocument2;
begin
Result:=0;
Msg:=RegisterWindowMessage('WM_HTML_GETOBJECT');
hnd:=FindWindowEx(Wnd,0,'Shell DocObject View',nil);
if hnd<>0 then hnd:=FindWindowEx(hnd, 0, 'Internet Explorer_Server', nil);
SendMessageTimeout(hnd,Msg,0,0,SMTO_ABORTIFHUNG,1000,Res);
if (ObjectFromLresult(Res,IHTMLDocument2,0,Doc)=S_OK) then begin
(Doc.parentWindow as IServiceProvider).QueryService(IWebBrowserApp,IWebBrowser2,Instance);
end;
end;

function CheckServerPageOpend(Surl:String; Ourl:String):Boolean;
begin
Result:=Pos('http://', LowerCase(Ourl)) > 0;
if Result then Result:=Pos(Surl,Ourl)>0;
end;

begin
Result:=False;
CliInfoRec.SerAddr:=GetServerPageDir(CliInfoRec.MainPage); //主页面虚拟目录
ShellWindow:=CoShellWindows.Create;
for i:=0 to ShellWindow.Count-1 do begin
vi:= i;
spDisp:=ShellWindow.Item(vi);
try
spDisp.QueryInterface(IWebBrowser2, IE1);
except
Continue;
end;
if Assigned(IE1) then begin
FrameHWND:=IE1.HWND;
if CheckServerPageOpend(GetServerPageDir(Url),IE1.LocationURL) then begin
if Assigned(IE1.Document) and (IE1.Document.QueryInterface(IHTMLDocument2, HTML1)=S_OK) and Assigned(HTML1) then begin
ExitFor:=False;
IEIC1:=HTML1.all;
for j:=0 to IEIC1.length-1 do begin
IESP:=IEIC1.item(j,0);
try
if IESP.QueryInterface(IHTMLInputElement,HtmlInputEle)=S_OK then begin
if Assigned(HtmlInputEle) then begin
ExitFor:=(LowerCase(HtmlInputEle.name)='staffid') and (LowerCase(HtmlInputEle.value)=LowerCase(CliInfoRec.StaffId));
if ExitFor then Break;
end;
end;
except
Continue;
end;
end;
if ExitFor then begin //找到IE窗口
//激活窗口
if OpenClose then begin
if StrToInt(GetIexploreFileVersion(IE1.FullName)[1])>=7 then begin
//获取tab handle
UIHWND:=FindWindowEx(FrameHWND,0,'CommandBarClass',nil);
UIHWND:=FindWindowEx(UIHWND,0,'ReBarWindow32',nil);
UIHWND:=FindWindowEx(UIHWND,0,'TabBandClass',nil);
UIHWND:=FindWindowEx(UIHWND,0,'DirectUIHWND',nil);
if AccessibleObjectFromWindow(UIHWND, OBJID_CLIENT ,IAccessible, accParent)=S_OK then begin
if FindIETabControlDisp(accParent, AccChild) then begin
if AccChild.get_accChildCount(TabsCount)=S_OK then begin
SetLength(ChildStruct, TabsCount);
try
if AccessibleChildren(Pointer(AccChild),0,TabsCount,ChildStruct[0],TabsReceived)=S_OK then begin
for j:=0 to TabsReceived-1 do begin
case VarType(ChildStruct[j]) of
varInteger: AccChild.Get_accChild(ChildStruct[j], tabDisp);
varDispatch: tabDisp := ChildStruct[j];
end;
if Assigned(tabdisp) and (tabdisp.QueryInterface(IAccessible, acctab) = S_OK) then begin
if acctab.Get_accDescription(CHILDID_SELF,tabcaption)=S_OK then begin
if CheckServerPageOpend(IE1.LocationURL,tabcaption) then begin
acctab.accDoDefaultAction(CHILDID_SELF);
Break;
end;
end;
end;
end;
end;
finally
SetLength(ChildStruct, 0);
end;
end;
end;
end;
end;
SetForegroundWindow(FrameHWND);
//BringWindowToTop(FrameHWND);
ShowWindow(FrameHWND,SW_SHOWMAXIMIZED);
//Windows.SetFocus(FrameHWND);
end else begin
OleVariant(spDisp).Quit;
{//
CloseWindow(FrameHWND);
SendMessage(FrameHWND,WM_CLOSE,0,0);
SendMessage(FrameHWND,WM_QUERYENDSESSION,0,0);
SendMessage(FrameHWND,WM_DESTROY,0,0);
//}
end;
Result:=True;
Break;
//}
end;
end;
end;
end;
end;
end;
 
unit Oleacc;

interface

uses
Windows, ActiveX, ComObj;

const
ACCDLL='OLEACC.DLL';

const
// PROPRIETES: Hierarchie
DISPID_ACC_PARENT =-5000;
DISPID_ACC_CHILDCOUNT =-5001;
DISPID_ACC_CHILD =-5002;

// PROPRIETES: Description
DISPID_ACC_NAME =-5003;
DISPID_ACC_VALUE =-5004;
DISPID_ACC_DESCRIPTION =-5005;
DISPID_ACC_ROLE =-5006;
DISPID_ACC_STATE =-5007;
DISPID_ACC_HELP =-5008;
DISPID_ACC_HELPTOPIC =-5009;
DISPID_ACC_KEYBOARDSHORTCUT =-5010;
DISPID_ACC_FOCUS =-5011;
DISPID_ACC_SELECTION =-5012;
DISPID_ACC_DEFAULTACTION =-5013;

// METHODES
DISPID_ACC_SELECT =-5014;
DISPID_ACC_LOCATION =-5015;
DISPID_ACC_NAVIGATE =-5016;
DISPID_ACC_HITTEST =-5017;
DISPID_ACC_DODEFAULTACTION =-5018;





// CONSTANTES

//
// Entrées de DISPID_ACC_NAVIGATE
//
const
NAVDIR_MIN =$00000000; // min
NAVDIR_UP =$00000001; // haut
NAVDIR_DOWN =$00000002; // bas
NAVDIR_LEFT =$00000003; // gauche
NAVDIR_RIGHT =$00000004; // droite
NAVDIR_NEXT =$00000005; // suivant
NAVDIR_PREVIOUS =$00000006; // précédent
NAVDIR_FIRSTCHILD =$00000007; // premier enfant
NAVDIR_LASTCHILD =$00000008; // dernier enfant
NAVDIR_MAX =$00000009; // max

// Entrées de DISPID_ACC_SELECT
SELFLAG_NONE =$00000000;
SELFLAG_TAKEFOCUS =$00000001;
SELFLAG_TAKESELECTION =$00000002;
SELFLAG_EXTENDSELECTION =$00000004;
SELFLAG_ADDSELECTION =$00000008;
SELFLAG_REMOVESELECTION =$00000010;
SELFLAG_VALID =$0000001F;

// Sorties de DISPID_ACC_STATE
STATE_SYSTEM_UNAVAILABLE =$00000001; //non disponible
STATE_SYSTEM_SELECTED =$00000002; //sélectionné
STATE_SYSTEM_FOCUSED =$00000004; //actif
STATE_SYSTEM_PRESSED =$00000008; //enfoncé
STATE_SYSTEM_CHECKED =$00000010; //coché
STATE_SYSTEM_MIXED =$00000020; //mélangé
STATE_SYSTEM_READONLY =$00000040; //lecture seule
STATE_SYSTEM_HOTTRACKED =$00000080; //suivi attentivement
STATE_SYSTEM_DEFAULT =$00000100; //par défaut
STATE_SYSTEM_EXPANDED =$00000200; //développé
STATE_SYSTEM_COLLAPSED =$00000400; //réduit
STATE_SYSTEM_BUSY =$00000800; //occupé
STATE_SYSTEM_FLOATING =$00001000; //flottant
STATE_SYSTEM_MARQUEED =$00002000; //défilant
STATE_SYSTEM_ANIMATED =$00004000; //animé
STATE_SYSTEM_INVISIBLE =$00008000; //invisible
STATE_SYSTEM_OFFSCREEN =$00010000; //en dehors de l'écran
STATE_SYSTEM_SIZEABLE =$00020000; //pouvant être dimensionné
STATE_SYSTEM_MOVEABLE =$00040000; //pouvant être déplacé
STATE_SYSTEM_SELFVOICING =$00080000; //vocalisation propre
STATE_SYSTEM_FOCUSABLE =$00100000; //pouvant être actif
STATE_SYSTEM_SELECTABLE =$00200000; //pouvant être sélectionné
STATE_SYSTEM_LINKED =$00400000; //lié
STATE_SYSTEM_TRAVERSED =$00800000; //traversé
STATE_SYSTEM_MULTISELECTABLE =$01000000; //permettant les sélections multiples
STATE_SYSTEM_EXTSELECTABLE =$02000000; //permettant les sélections étendues
STATE_SYSTEM_ALERT_LOW =$04000000; //alerte basse
STATE_SYSTEM_ALERT_MEDIUM =$08000000; //alerte moyenne
STATE_SYSTEM_ALERT_HIGH =$10000000; //alerte haute
STATE_SYSTEM_VALID =$1FFFFFFF; //valide

// Sorties de DISPID_ACC_ROLE
ROLE_SYSTEM_TITLEBAR =$00000001; //barre de titre
ROLE_SYSTEM_MENUBAR =$00000002; //barre de menus
ROLE_SYSTEM_SCROLLBAR =$00000003; //barre de défilement
ROLE_SYSTEM_GRIP =$00000004; //poignée
ROLE_SYSTEM_SOUND =$00000005; //son
ROLE_SYSTEM_CURSOR =$00000006; //curseur
ROLE_SYSTEM_CARET =$00000007; //point d'insertion
ROLE_SYSTEM_ALERT =$00000008; //alerte
ROLE_SYSTEM_WINDOW =$00000009; //fenêtre
ROLE_SYSTEM_CLIENT =$0000000A; //client
ROLE_SYSTEM_MENUPOPUP =$0000000B; //menu contextuel
ROLE_SYSTEM_MENUITEM =$0000000C; //élément de menu
ROLE_SYSTEM_TOOLTIP =$0000000D; //astuce
ROLE_SYSTEM_APPLICATION =$0000000E; //application
ROLE_SYSTEM_DOCUMENT =$0000000F; //document
ROLE_SYSTEM_PANE =$00000010; //volet
ROLE_SYSTEM_CHART =$00000011; //graphe
ROLE_SYSTEM_DIALOG =$00000012; //bo?te de dialogue
ROLE_SYSTEM_BORDER =$00000013; //bordure
ROLE_SYSTEM_GROUPING =$00000014; //groupement
ROLE_SYSTEM_SEPARATOR =$00000015; //séparateur
ROLE_SYSTEM_TOOLBAR =$00000016; //barre d'outils
ROLE_SYSTEM_STATUSBAR =$00000017; //barre d'état
ROLE_SYSTEM_TABLE =$00000018; //tableau
ROLE_SYSTEM_COLUMNHEADER =$00000019; //en-tête de colonne
ROLE_SYSTEM_ROWHEADER =$0000001A; //en-tête de ligne
ROLE_SYSTEM_COLUMN =$0000001B; //colonne
ROLE_SYSTEM_ROW =$0000001C; //ligne
ROLE_SYSTEM_CELL =$0000001D; //cellule
ROLE_SYSTEM_LINK =$0000001E; //lien
ROLE_SYSTEM_HELPBALLOON =$0000001F; //bulle d'aide
ROLE_SYSTEM_CHARACTER =$00000020; //personnage
ROLE_SYSTEM_LIST =$00000021; //liste
ROLE_SYSTEM_LISTITEM =$00000022; //élément de liste
ROLE_SYSTEM_OUTLINE =$00000023; //arborescence
ROLE_SYSTEM_OUTLINEITEM =$00000024; //élément d'arborescence
ROLE_SYSTEM_PAGETAB =$00000025; //onglet
ROLE_SYSTEM_PROPERTYPAGE =$00000026; //page de propriétés
ROLE_SYSTEM_INDICATOR =$00000027; //indicateur
ROLE_SYSTEM_GRAPHIC =$00000028; //image
ROLE_SYSTEM_STATICTEXT =$00000029; //texte
ROLE_SYSTEM_TEXT =$0000002A; //texte modifiable
ROLE_SYSTEM_PUSHBUTTON =$0000002B; //bouton poussoir
ROLE_SYSTEM_CHECKBUTTON =$0000002C; //case à cocher
ROLE_SYSTEM_RADIOBUTTON =$0000002D; //case d'option
ROLE_SYSTEM_COMBOBOX =$0000002E; //zone de liste modifiable
ROLE_SYSTEM_DROPLIST =$0000002F; //liste déroulante
ROLE_SYSTEM_PROGRESSBAR =$00000030; //barre de progression
ROLE_SYSTEM_DIAL =$00000031; //bouton rotatif
ROLE_SYSTEM_HOTKEYFIELD =$00000032; //champ de touche de raccourci clavier
ROLE_SYSTEM_SLIDER =$00000033; //potentiomètre
ROLE_SYSTEM_SPINBUTTON =$00000034; //zone de sélection numérique
ROLE_SYSTEM_DIAGRAM =$00000035; //diagramme
ROLE_SYSTEM_ANIMATION =$00000036; //animation
ROLE_SYSTEM_EQUATION =$00000037; //équation
ROLE_SYSTEM_BUTTONDROPDOWN =$00000038; //bouton de liste déroulante
ROLE_SYSTEM_BUTTONMENU =$00000039; //bouton de menu
ROLE_SYSTEM_BUTTONDROPDOWNGRID =$0000003A; //bouton de liste déroulante de grille
ROLE_SYSTEM_WHITESPACE =$0000003B; //espace forcé
ROLE_SYSTEM_PAGETABLIST =$0000003C; //liste d'onglets
ROLE_SYSTEM_CLOCK =$0000003D; //horloge


const
LIBID_Accessibility: TGUID = '{1ea4dbf0-3c3b-11cf-810c-00aa00389b71}';
IID_IAccessible: TGUID = '{618736e0-3c3d-11cf-810c-00aa00389b71}';
IID_IDispatch: TGUID = '{a6ef9860-c720-11d0-9337-00a0c90dcaa9}';
IID_IEnumVARIANT: TGUID = '{00020404-0000-0000-c000-000000000046}';

type
IEnumVariant = interface(IUnknown)
['{00020404-0000-0000-C000-000000000046}']
function Next(celt: LongWord; var rgvar : OleVariant; out pceltFetched: LongWord): HResult; stdcall;
function Skip(celt: LongWord): HResult; stdcall;
function Reset: HResult; stdcall;
function Clone(out Enum: IEnumVariant): HResult; stdcall;
end;

type
IAccessible = interface(IDispatch)
['{618736E0-3C3D-11CF-810C-00AA00389B71}']
function Get_accParent(out ppdispParent: IDispatch): HResult; stdcall;
function Get_accChildCount(out pcountChildren: Integer): HResult; stdcall;
function Get_accChild(varChild: OleVariant; out ppdispChild: IDispatch): HResult; stdcall;
function Get_accName(varChild: OleVariant; out pszName: WideString): HResult; stdcall;
function Get_accValue(varChild: OleVariant; out pszValue: WideString): HResult; stdcall;
function Get_accDescription(varChild: OleVariant; out pszDescription: WideString): HResult; stdcall;
function Get_accRole(varChild: OleVariant; out pvarRole: OleVariant): HResult; stdcall;
function Get_accState(varChild: OleVariant; out pvarState: OleVariant): HResult; stdcall;
function Get_accHelp(varChild: OleVariant; out pszHelp: WideString): HResult; stdcall;
function Get_accHelpTopic(out pszHelpFile: WideString; varChild: OleVariant;
out pidTopic: Integer): HResult; stdcall;
function Get_accKeyboardShortcut(varChild: OleVariant; out pszKeyboardShortcut: WideString): HResult; stdcall;
function Get_accFocus(out pvarChild: OleVariant): HResult; stdcall;
function Get_accSelection(out pvarChildren: OleVariant): HResult; stdcall;
function Get_accDefaultAction(varChild: OleVariant; out pszDefaultAction: WideString): HResult; stdcall;
function accSelect(flagsSelect: Integer; varChild: OleVariant): HResult; stdcall;
function accLocation(out pxLeft: Integer; out pyTop: Integer; out pcxWidth: Integer;
out pcyHeight: Integer; varChild: OleVariant): HResult; stdcall;
function accNavigate(navDir: Integer; varStart: OleVariant; out pvarEndUpAt: OleVariant): HResult; stdcall;
function accHitTest(xLeft: Integer; yTop: Integer; out pvarChild: OleVariant): HResult; stdcall;
function accDoDefaultAction(varChild: OleVariant): HResult; stdcall;
function Set_accName(varChild: OleVariant; const pszName: WideString): HResult; stdcall;
function Set_accValue(varChild: OleVariant; const pszValue: WideString): HResult; stdcall;
end;

function AccessibleObjectFromWindow(AHWnd: HWND; dwObjectID: DWORD;
const riid: TGUID; out ppvObject):HResult; stdcall;
external 'OLEACC.DLL' name 'AccessibleObjectFromWindow';

function AccessibleChildren(paccContainer: Pointer; iChildStart: LONGINT;
cChildren: LONGINT; out rgvarChildren: OleVariant;
out pcObtained: LONGINT): HRESULT; stdcall;
external 'OLEACC.DLL' name 'AccessibleChildren';

function ObjectFromLresult(Res: LRESULT; const IID: TGUID; Param: WPARAM;
out pObject): HRESULT; stdcall;
external 'OLEACC.DLL' name 'ObjectFromLresult';

function AccessibleObjectFromEvent(wnd:HWND;dwId:DWORD;dwChildId:DWORD;
out PAccessible; out pvarChild:OleVariant):HRESULT; stdcall;
external 'OLEACC.DLL' name 'AccessibleObjectFromEvent';

function AccessibleObjectFromPoint(ptScreen:TPoint; out PAccessible;
out pvarChild:OleVariant):HRESULT; stdcall;
external 'OLEACC.DLL' name 'AccessibleObjectFromPoint';

function CreateStdAccessibleObject(wnd:HWND;idObject:longint;riid:TGUID;
out ppvObject):HRESULT; stdcall;
external 'OLEACC.DLL' name 'CreateStdAccessibleObject';

function CreateStdAccessibleProxyA(wnd:HWND;pszClassName:pchar;idObject:
longint;riid:TGUID;out ppvObject):HRESULT;stdcall;
external 'OLEACC.DLL' name 'CreateStdAccessibleProxyA';

function CreateStdAccessibleProxyW(wnd:HWND;pszClassName:pchar;idObject:longint;
riid:TGUID;out ppvObject):HRESULT;stdcall;
external 'OLEACC.DLL' name 'CreateStdAccessibleProxyW';

function CreateStdAccessibleProxy(wnd:HWND;pszClassName:pchar;idObject:longint;
riid:TGUID;out ppvObject):HRESULT;stdcall;
external 'OLEACC.DLL' name 'CreateStdAccessibleProxyA';

function WindowFromAccessibleObject(pAcc:IAccessible; var phwnd:HWND):HRESULT;stdcall;
external 'OLEACC.DLL' name 'WindowFromAccessibleObject';

function GetOleaccVersionInfo(var pdwVer:DWord; var pdwBuild:DWord):HRESULT;stdcall;
external 'OLEACC.DLL' name 'GetOleaccVersionInfo';

function LresultFromObject(riid:TGUID;wParam:WPARAM;pAcc:IAccessible):HRESULT; stdcall;
external 'OLEACC.DLL' name 'LresultFromObject';

function GetRoleTextA(lRole:DWORD;lpszRole:pchar;cchRoleMax:byte):HRESULT; stdcall;
external 'OLEACC.DLL' name 'GetRoleTextA';

function GetRoleTextW(lRole:DWORD;lpszRole:pchar;cchRoleMax:Integer):HRESULT; stdcall;
external 'OLEACC.DLL' name 'GetRoleTextW';

function GetRoleText(lRole:DWORD;lpszRole:pchar;cchRoleMax:Integer):HRESULT; stdcall;
external 'OLEACC.DLL' name 'GetRoleTextA';

function GetStateTextA(lStateBit:DWORD;lpszState:pchar;cchStateMax:Integer):HRESULT;stdcall;
external 'OLEACC.DLL' name 'GetStateTextA';

function GetStateTextW(lStateBit:DWORD;lpszState:pchar;cchStateMax:Integer):HRESULT;stdcall;
external 'OLEACC.DLL' name 'GetStateTextW';

function GetStateText(lStateBit:DWORD;lpszState:pchar;cchStateMax:Integer):HRESULT;stdcall;
external ACCDLL name 'GetStateTextA';


implementation

end.
 
后退
顶部