createwindowex api call

T

Tony

I can't seen to get the createwindowex api call working,
what am I doing wrong. I am actually using visual basic 6.

here is a sample,


Public Const WC_IE = "Shell DocObject View"

Declare Function CreateWindowEx Lib "user32.dll"
Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal
lpClassName As String, ByVal lpWindowName As String, ByVal
dwStyle As Long, ByVal X As Long, ByVal y As Long, ByVal
nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As
Long, ByVal hMenu As Long, ByVal hInstance As Long,
lpParam As Any) As Long


ReturnValue = CreateWindowEx(0, WC_IE, "", WS_CHILD, 0, 0,
0, 0, Parenthandle, 0, 0, ByVal CLng(0))


I have actually wm_closed Shell DocObject View, and am
trying to re-establish it in the same parent window.

Any ideas welcome thanks.
 
H

Herfried K. Wagner [MVP]

* "Tony said:
I can't seen to get the createwindowex api call working,
what am I doing wrong. I am actually using visual basic 6.

here is a sample,

Public Const WC_IE = "Shell DocObject View"

Declare Function CreateWindowEx Lib "user32.dll"
Alias "CreateWindowExA"

Remove the 'Alias...' and declare the function as 'Auto'.
(ByVal dwExStyle As Long, ByVal
lpClassName As String, ByVal lpWindowName As String, ByVal
dwStyle As Long, ByVal X As Long, ByVal y As Long, ByVal
nWidth As Long, ByVal nHeight As Long,

Replace all 'As Long' with 'As Int32'.
ByVal hWndParent As
Long, ByVal hMenu As Long, ByVal hInstance As Long,

Replace all of the 'As Long' above with 'As IntPtr'.
lpParam As Any) As Long

Declare the last parameter as 'Int32' and the return value as 'IntPtr'.
ReturnValue = CreateWindowEx(0, WC_IE, "", WS_CHILD, 0, 0,
0, 0, Parenthandle, 0, 0, ByVal CLng(0))

Replace the 'ByVal CLng(0)' with '0'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Dilbert's words of wisdom #18: Never argue with an idiot. They drag you down
to their level then beat you with experience.
 
T

Tom Shelton

I can't seen to get the createwindowex api call working,
what am I doing wrong. I am actually using visual basic 6.

here is a sample,


Public Const WC_IE = "Shell DocObject View"

Declare Function CreateWindowEx Lib "user32.dll"
Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal
lpClassName As String, ByVal lpWindowName As String, ByVal
dwStyle As Long, ByVal X As Long, ByVal y As Long, ByVal
nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As
Long, ByVal hMenu As Long, ByVal hInstance As Long,
lpParam As Any) As Long


ReturnValue = CreateWindowEx(0, WC_IE, "", WS_CHILD, 0, 0,
0, 0, Parenthandle, 0, 0, ByVal CLng(0))


I have actually wm_closed Shell DocObject View, and am
trying to re-establish it in the same parent window.

Any ideas welcome thanks.

This is old - dates back to the VB5 days... But here is a complete API
based windows program that I converted from some C sample.

http://mtogden.com/~tom/backup/code.html

Gosh - those were the days :) Anyway, might want to ask further
questions on this on one of the VB.CLASSIC groups since this is really a
VB.NET group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top