A tip and a question. I ran my head into the wall here for a while,
trying to send a negative lParam value to a control with no result.
Turned out I had declared all four members in control's MainWndProc
as DWORD's. Yes I know, I sometimes do such stupid things..
Anyway, I looked around at some samples in source code Forum and
discovered I'm not the first one to do this mistake. In several
samples, members like lParam is declared as DWORD, with the result
that you never can send a negative value to that member.
Okay, so that was the tip. Check you message handlers - wParam and
lParam must always be LONG's (%TRUE is negative = -1).
Now for the question: Does this also apply to hWnd and wMsg? I
noticed different examples on this one as well, where both DWORD
and LONG was used in a mix. What gives? Is there ever a situation
where using LONG's all the way would risk breaking some message or
hWnd? This is how I usually do it ( when my mind is working), but
is it 100% safe in all systems/situations?
------------------
trying to send a negative lParam value to a control with no result.
Turned out I had declared all four members in control's MainWndProc
as DWORD's. Yes I know, I sometimes do such stupid things..

Anyway, I looked around at some samples in source code Forum and
discovered I'm not the first one to do this mistake. In several
samples, members like lParam is declared as DWORD, with the result
that you never can send a negative value to that member.
Okay, so that was the tip. Check you message handlers - wParam and
lParam must always be LONG's (%TRUE is negative = -1).
Now for the question: Does this also apply to hWnd and wMsg? I
noticed different examples on this one as well, where both DWORD
and LONG was used in a mix. What gives? Is there ever a situation
where using LONG's all the way would risk breaking some message or
hWnd? This is how I usually do it ( when my mind is working), but
is it 100% safe in all systems/situations?
Code:
FUNCTION MainWndProc(BYVAL hWnd AS LONG, BYVAL wMsg AS LONG,_ BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
------------------
Comment