Getting window handle of AXControlSite 
Author Message
 Getting window handle of AXControlSite

Is there a way to get the window handle of an AXControlSite even if/when
there is no window displayed?

What I need to do is to call a WinInet function to establish a dialup
connection, and it requires a window handle. I have been getting the job
done by make the following call so far:

   WinInetLibrary default InternetDial: (theWindow handle)
                                       lpszConnectoid: theConnectoid
                                       dwFlags: 0
                                       lpdwConnection: connectStatus
                                       dwReserved: 0.

"theWindow" is nothing but a window returned by "ShellView new." Well, what
I have done is bad on a number of fronts. First, it calls a private method
"handle".  Second, it creates a window which I don't really need at all,
just to be able to initiate a dialup connection.  So I  would like to do
this correctly.  I am actually using some custom IWebBrowser classes
provided by Steve Waring to control Internet Explorer and MSHTML, but (I
think) the problem is the same whether I use Steve's classes or an
AXControlSite without actually showing a window.  This is in fact what I
want to do--control Explorer and get some data from the internet in a
totally unattended, windowless mode.  But I guess that I do need to allocate
a window in order make the WinInet call.  Note that the COM interface to
Explorer has a method to get a window handle, but I haven't gotten this to
work.  Sorry for the rambling here, but that happens when I don't really
know which direction to go :(.

Thanks for any advice.

John Whittaker



Mon, 21 Jul 2003 12:44:27 GMT  
 Getting window handle of AXControlSite
Hi John,

Me again:)

Have you tried this function (For WinInetLibrary);
=======================
internetAutodial: dwFlags dwReserved: dword

"Automatically causes the modem to dial the default Internet connection"
   "BOOL InternetAutodial(
    IN DWORD dwFlags,
    IN DWORD dwReserved
    );"

"// Flags for InternetAutodial
#define INTERNET_AUTODIAL_FORCE_ONLINE 1
#define INTERNET_AUTODIAL_FORCE_UNATTENDED 2
#define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4
"
<stdcall: bool InternetAutodial dword dword>
^self invalidCall
=====================
This creates a connection without intervention on my machine.

I suspect that you could use nil instead of a Window handle in InternetDial
as well, but have a good backup before trying.

Steve


Quote:
> Is there a way to get the window handle of an AXControlSite even if/when
> there is no window displayed?

> What I need to do is to call a WinInet function to establish a dialup
> connection, and it requires a window handle. I have been getting the job
> done by make the following call so far:

>    WinInetLibrary default InternetDial: (theWindow handle)
>                                        lpszConnectoid: theConnectoid
>                                        dwFlags: 0
>                                        lpdwConnection: connectStatus
>                                        dwReserved: 0.

> "theWindow" is nothing but a window returned by "ShellView new." Well,
what
> I have done is bad on a number of fronts. First, it calls a private method
> "handle".  Second, it creates a window which I don't really need at all,
> just to be able to initiate a dialup connection.  So I  would like to do
> this correctly.  I am actually using some custom IWebBrowser classes
> provided by Steve Waring to control Internet Explorer and MSHTML, but (I
> think) the problem is the same whether I use Steve's classes or an
> AXControlSite without actually showing a window.  This is in fact what I
> want to do--control Explorer and get some data from the internet in a
> totally unattended, windowless mode.  But I guess that I do need to
allocate
> a window in order make the WinInet call.  Note that the COM interface to
> Explorer has a method to get a window handle, but I haven't gotten this to
> work.  Sorry for the rambling here, but that happens when I don't really
> know which direction to go :(.

> Thanks for any advice.

> John Whittaker



Mon, 21 Jul 2003 16:12:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Windows - getting Tkinter or wxPython window handle?

2. getting window handle (MS Windows) from PPST

3. Getting the Window Handle in VW2.5

4. AXControlSite

5. About the event of AXControlSite.

6. AXControlSite/VC problem

7. AXControlSite questions

8. Window Handle / Maximize dos window ???

9. win32ui: The window handle does not specify a valid window

10. VW: getting a graphics handle (easy question?)

11. Alert Keys On AppFrame Not Getting Handled

12. Getting a progs handle

 

 
Powered by phpBB® Forum Software