Click here to Skip to main content
15,900,108 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Get the proper path name, proper case I mean. Pin
AndrewVos8-May-08 6:12
AndrewVos8-May-08 6:12 
Questiongetting input from user Pin
raydona7-May-08 8:11
raydona7-May-08 8:11 
AnswerRe: getting input from user Pin
Dave Kreskowiak7-May-08 8:42
mveDave Kreskowiak7-May-08 8:42 
Questionhow to use SetWindowLong API function calling in Vb.net Pin
brams77-May-08 4:04
brams77-May-08 4:04 
AnswerRe: how to use SetWindowLong API function calling in Vb.net Pin
Dave Kreskowiak7-May-08 7:12
mveDave Kreskowiak7-May-08 7:12 
GeneralRe: how to use SetWindowLong API function calling in Vb.net Pin
brams77-May-08 10:33
brams77-May-08 10:33 
GeneralRe: how to use SetWindowLong API function calling in Vb.net Pin
Dave Kreskowiak7-May-08 10:57
mveDave Kreskowiak7-May-08 10:57 
GeneralRe: how to use SetWindowLong API function calling in Vb.net Pin
brams79-May-08 4:40
brams79-May-08 4:40 
Am sorry to trouble you again. I'm confused. I might not getting what you are saying. I am not a much experienced developer. I'm using VB.Net with .Net Framework 1.1. Please see below what have tried -

Public Enum WindowMessage As Integer
WM_ACTIVATE = 6 ' can't use Hex value WM_ACTIVATE = 0x0006 giving error 'End of statement expected so converted that hex value to decimal as 6.
End Enum

Public Delegate Function WndProc(ByVal hWnd As Integer, ByVal msg As Messages.WindowMessages, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Error - Messages.WindowMessages - Type is not defined

Friend Declare Auto Function SetWindowLong Lib "user32.dll" (ByVal hwnd As Int32, ByVal nIndex As WindowProcs, ByVal NewProc As Messages.WndProc) As Boolean
Error - Messages.WndProc - Type is not defined

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Integer, _
ByVal nIndex As Integer, _
ByVal dwNewLong As MyFunctionDelegate) As Integer

My hook function looks like this -
Public Sub Hook()
Try
Dim intError As Integer = GetLastError
MsgBox(intError)

SetLastError(1)
Dim intError1 As Integer = GetLastError

lpPrevWndProc = SetWindowLong(ghW, GWL_WNDPROC, AddressOf MyFunction)

Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub
Note - Getting Last Error as 126 which means 'Module not found.'


MyFunction Delegate is like this -

Public Delegate Function MyFunctionDelegate(ByVal hw As Integer, ByVal uMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

MyFunction looks like this -
Public Function MyFunction(ByVal hw As Integer, _
ByVal uMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer

Select Case uMsg.ToString
Case ABC
do this
Case DEF
do this
Case Else
MyFunction= CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, lParam)
End Select
End Function

Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Integer, _
ByVal hWnd As Integer, _
ByVal Msg As Integer, _
ByVal wParm As Integer, _
ByVal lParam As Integer) As Integer
GeneralRe: how to use SetWindowLong API function calling in Vb.net Pin
Dave Kreskowiak9-May-08 5:44
mveDave Kreskowiak9-May-08 5:44 
QuestionLooking for something that replaces the event DataGridView.SelectionChanging Pin
Shimmy Weitzhandler6-May-08 12:21
Shimmy Weitzhandler6-May-08 12:21 
AnswerRe: Looking for something that replaces the event DataGridView.SelectionChanging Pin
Shimmy Weitzhandler6-May-08 12:57
Shimmy Weitzhandler6-May-08 12:57 
Question[Message Deleted] Pin
Macorina6-May-08 10:41
Macorina6-May-08 10:41 
AnswerCross Post. Please ignore Pin
Pete O'Hanlon6-May-08 10:56
mvePete O'Hanlon6-May-08 10:56 
GeneralRe: Cross Post. Please ignore Pin
leckey7-May-08 6:46
leckey7-May-08 6:46 
GeneralRe: Cross Post. Please ignore Pin
Pete O'Hanlon7-May-08 9:10
mvePete O'Hanlon7-May-08 9:10 
GeneralRe: Cross Post. Please ignore Pin
iamstillalive7-May-08 22:56
iamstillalive7-May-08 22:56 
GeneralRe: Cross Post. Please ignore Pin
Pete O'Hanlon8-May-08 0:51
mvePete O'Hanlon8-May-08 0:51 
GeneralRe: Cross Post. Please ignore Pin
Dave Kreskowiak8-May-08 2:56
mveDave Kreskowiak8-May-08 2:56 
GeneralRe: Cross Post. Please ignore Pin
leckey8-May-08 3:02
leckey8-May-08 3:02 
GeneralRe: Cross Post. Please ignore Pin
Pete O'Hanlon8-May-08 1:40
mvePete O'Hanlon8-May-08 1:40 
GeneralRe: Cross Post. Please ignore Pin
leckey8-May-08 3:03
leckey8-May-08 3:03 
GeneralRe: Cross Post. Please ignore Pin
Pete O'Hanlon8-May-08 4:03
mvePete O'Hanlon8-May-08 4:03 
GeneralRe: Cross Post. Please ignore [modified] Pin
Macorina8-May-08 6:17
Macorina8-May-08 6:17 
GeneralRe: Cross Post. Please ignore Pin
Pete O'Hanlon8-May-08 9:02
mvePete O'Hanlon8-May-08 9:02 
GeneralRe: Cross Post. Please ignore Pin
Macorina8-May-08 9:10
Macorina8-May-08 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.