Try this out:
Code: Select all
Procedure MyWindowCallback(hWnd, message, wParam, lParam)
Select message
Case #WM_RBUTTONUP
Debug "right button up!"
EndSelect
Result = DefWindowProc_(hWnd, message, wParam, lParam)
ProcedureReturn Result
EndProcedure
PV.WNDCLASSEX ;PV = PropertyViewer
PVClass.s = "PViewer"
PV\cbSize = SizeOf(PV)
PV\style = #CS_HREDRAW | #CS_VREDRAW
PV\lpfnWndProc = @MyWindowCallback()
PV\cbClsExtra = 0
PV\cbWndExtra = 0
PV\hInstance = hInstance
PV\hIcon = LoadIcon_(NULL, IDI_APPLICATION)
PV\hCursor = LoadCursor_(NULL, IDC_ARROW)
PV\hbrBackground = GetStockObject_( #WHITE_BRUSH)
PV\lpszMenuName = 0
PV\lpszClassName = @PVClass
PV\hIconSm = 0
RegisterClassEx_(@PV)
hwnd = CreateWindowEx_(0, "PViewer", "sample", #WS_OVERLAPPEDWINDOW, #CW_USEDEFAULT, #CW_USEDEFAULT, #CW_USEDEFAULT, #CW_USEDEFAULT, #Null, #Null, GetModuleHandle_(0), #Null)
ShowWindow_(hwnd, 1)
;UpdateWindow_(hwnd)
ret.b = GetMessage_(@msg, hwnd, 0, 0 )
While msg <> 0
If ret = -1
Debug "error!"
Else
TranslateMessage_(@msg)
DispatchMessage_(@msg)
EndIf
ret = GetMessage_(@msg, hwnd, 0, 0 )
Wend

