Mercurial > dwindows
comparison win/dw.c @ 1467:91bdd9840b9f
_toplevel_window() changes for Windows similar to the OS/2 changes...
If the class checks are too slow we can remove them on both platforms...
it is just an extra level of security to make sure we are actually returning
a toplevel window.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 18 Dec 2011 12:12:46 +0000 |
parents | e325f98a2792 |
children | 1794caee0758 |
comparison
equal
deleted
inserted
replaced
1466:65986481a3d8 | 1467:91bdd9840b9f |
---|---|
1066 HWND box, lastbox = GetParent(handle); | 1066 HWND box, lastbox = GetParent(handle); |
1067 | 1067 |
1068 /* Find the toplevel window */ | 1068 /* Find the toplevel window */ |
1069 while((box = GetParent(lastbox))) | 1069 while((box = GetParent(lastbox))) |
1070 { | 1070 { |
1071 /* If it hasn't been packed yet.. */ | |
1071 if(box == DW_HWND_OBJECT) | 1072 if(box == DW_HWND_OBJECT) |
1072 return 0; | 1073 return 0; |
1073 lastbox = box; | 1074 lastbox = box; |
1074 } | 1075 } |
1075 if(lastbox) | 1076 if(lastbox) |
1076 return lastbox; | 1077 { |
1077 return handle; | 1078 char tmpbuf[100]; |
1079 | |
1080 GetClassName(lastbox, tmpbuf, 99); | |
1081 | |
1082 if(strncmp(tmpbuf, ClassName, strlen(ClassName)+1)==0) | |
1083 return lastbox; | |
1084 } | |
1085 return 0; | |
1078 } | 1086 } |
1079 | 1087 |
1080 /* This function finds the current widget in the | 1088 /* This function finds the current widget in the |
1081 * layout and moves the current focus to the next item. | 1089 * layout and moves the current focus to the next item. |
1082 */ | 1090 */ |