comparison os2/dw.c @ 1197:cad6f7aa421c

Fixed a couple slight issues with the last commit. Check >= for the GlobalID to avoid threading issues... Also had the wrong comparison in LN_SELECT/SLN_CHANGE.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 28 Sep 2011 16:58:42 +0000
parents 452a5b1b2aa5
children 1ef76e93db82
comparison
equal deleted inserted replaced
1196:452a5b1b2aa5 1197:cad6f7aa421c
133 USHORT _GlobalID(void) 133 USHORT _GlobalID(void)
134 { 134 {
135 static USHORT GlobalID = 9999; 135 static USHORT GlobalID = 9999;
136 136
137 GlobalID++; 137 GlobalID++;
138 if(GlobalID == 65535) 138 if(GlobalID >= 65535)
139 { 139 {
140 GlobalID = 10000; 140 GlobalID = 10000;
141 } 141 }
142 return GlobalID; 142 return GlobalID;
143 } 143 }
2619 2619
2620 if(strncmp(classbuf, "#38", 4) == 0) 2620 if(strncmp(classbuf, "#38", 4) == 0)
2621 { 2621 {
2622 int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction; 2622 int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
2623 2623
2624 if(tmp->window == hWnd || notifyhwnd == hWnd) 2624 if(tmp->window == hWnd || tmp->window == notifyhwnd)
2625 { 2625 {
2626 static int lastvalue = -1; 2626 static int lastvalue = -1;
2627 static HWND lasthwnd = NULLHANDLE; 2627 static HWND lasthwnd = NULLHANDLE;
2628 int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0); 2628 int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
2629 if(lastvalue != ulValue || lasthwnd != tmp->window) 2629 if(lastvalue != ulValue || lasthwnd != tmp->window)