468,283 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

Help using Addressof operator

I have one vb6 application in which it uses one variable

Private m_wndprcNext

and uses in

SetWindowLong hWndCur, GWL_WNDPROC, m_wndprcNex

one other calling of method is in same clas

Sub SubClass(hwnd&
m_wndprcNext = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf CtlProc
End Su

when i convert it into VB.NET the error is for Addressof CtlProc which was resolve

I can declare it with delegat

like thi

Delegate Function SubClassProcDelegate(ByVal hwnd As Integer, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Intege
Declare Function SetWindowLong Lib "USER32.DLL" Alias "SetWindowLongA" (ByVal hwnd As Integer, ByVal attr As Integer, ByVal lVal As SubClassProcDelegate) As Intege

please give me the solution what about the declration of below method calling?

SetWindowLong hWndCur, GWL_WNDPROC, m_wndprcNex

m_wndprcNext is the pointer variable as mention above

Please help me in this regard. its an urgen

Thank
owais

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 21 '05 #1
3 4870
Hi,

Little confused by this question. The setwindowlong does
not have a call back function. Here is an example that will find the
outlook express window and minimize it.
Api declares and constants
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _

(ByVal hwnd As IntPtr, ByVal nIndex As Integer, _

ByVal dwNewLong As Integer) As Integer

Const WS_MINIMIZE As Integer = &H20000000

Const GWL_STYLE As Integer = (-16)

How to find and minimize

For Each p As Process In Process.GetProcessesByName("msimn")

SetWindowLong(p.MainWindowHandle, GWL_STYLE, WS_MINIMIZE)

Next

Ken

-----------------------
"owais" <sohail29@-NOSPAM-hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP09.phx.gbl...
I have one vb6 application in which it uses one variable

Private m_wndprcNext&

and uses in

SetWindowLong hWndCur, GWL_WNDPROC, m_wndprcNext

one other calling of method is in same class

Sub SubClass(hwnd&)
m_wndprcNext = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf CtlProc)
End Sub

when i convert it into VB.NET the error is for Addressof CtlProc which was
resolved

I can declare it with delegate

like this

Delegate Function SubClassProcDelegate(ByVal hwnd As Integer, ByVal msg As
Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Declare Function SetWindowLong Lib "USER32.DLL" Alias "SetWindowLongA"
(ByVal hwnd As Integer, ByVal attr As Integer, ByVal lVal As
SubClassProcDelegate) As Integer
please give me the solution what about the declration of below method
calling?

SetWindowLong hWndCur, GWL_WNDPROC, m_wndprcNext

m_wndprcNext is the pointer variable as mention above.

Please help me in this regard. its an urgent

Thanks
owais

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 21 '05 #2
"owais" <sohail29@-NOSPAM-hotmail.com> schrieb:
I have one vb6 application in which it uses one variable

Private m_wndprcNext&

and uses in

SetWindowLong hWndCur, GWL_WNDPROC, m_wndprcNext

one other calling of method is in same class

Sub SubClass(hwnd&)
m_wndprcNext = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf CtlProc)
End Sub


You may want to override the form's 'WndProc' method instead of using
'SetWindowLong' to use your own window procedure.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Thanks for the reply

For your confusion read the below article

http://msdn.microsoft.com/library/de...l/vbup1048.asp

Thanks

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by serge calderara | last post: by
7 posts views Thread by UGH | last post: by
1 post views Thread by john | last post: by
2 posts views Thread by john | last post: by
55 posts views Thread by Sam | last post: by
3 posts views Thread by mario.rossi | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.