By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,312 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,312 IT Pros & Developers. It's quick & easy.

Help using Addressof operator

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
"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

P: n/a
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.