winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
944 discussions
Start a n
N
ew thread
Alexander Dorofeyev : devenum: Update type when reading binary data to VT_EMPTY variant.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: cff08308d08a042e0a6553d2e6a077bac17553f6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cff08308d08a042e0a6553d2e…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv> Date: Tue Jun 24 16:45:16 2008 +0300 devenum: Update type when reading binary data to VT_EMPTY variant. --- dlls/devenum/mediacatenum.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c index 331130b..a4d45dc 100644 --- a/dlls/devenum/mediacatenum.c +++ b/dlls/devenum/mediacatenum.c @@ -173,10 +173,13 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read( switch (V_VT(pVar)) { case VT_EMPTY: + V_VT(pVar) = VT_ARRAY | VT_UI1; + /* fall through */ case VT_ARRAY | VT_UI1: if (!(V_UNION(pVar, parray) = SafeArrayCreate(VT_UI1, 1, &bound))) res = E_OUTOFMEMORY; - res = S_OK; + else + res = S_OK; break; }
1
0
0
0
Alexander Dorofeyev : quartz: Do not ignore current position in IEnumRegFiltersImpl_Next.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 2d8f7268abae9c3a7086e62cf9cbcf95125c6d22 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d8f7268abae9c3a7086e62cf…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv> Date: Tue Jun 24 16:44:57 2008 +0300 quartz: Do not ignore current position in IEnumRegFiltersImpl_Next. --- dlls/quartz/enumregfilters.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/enumregfilters.c b/dlls/quartz/enumregfilters.c index 2816f08..f8d7820 100644 --- a/dlls/quartz/enumregfilters.c +++ b/dlls/quartz/enumregfilters.c @@ -152,7 +152,7 @@ static HRESULT WINAPI IEnumRegFiltersImpl_Next(IEnumRegFilters * iface, ULONG cF for(i = 0; i < cFetched; i++) { /* The string in the REGFILTER structure must be allocated in the same block as the REGFILTER structure itself */ - ppRegFilter[i] = CoTaskMemAlloc(sizeof(REGFILTER)+(strlenW(This->RegFilters[i].Name)+1)*sizeof(WCHAR)); + ppRegFilter[i] = CoTaskMemAlloc(sizeof(REGFILTER)+(strlenW(This->RegFilters[This->uIndex + i].Name)+1)*sizeof(WCHAR)); if (!ppRegFilter[i]) { while(i) @@ -162,9 +162,10 @@ static HRESULT WINAPI IEnumRegFiltersImpl_Next(IEnumRegFilters * iface, ULONG cF } return E_OUTOFMEMORY; } - ppRegFilter[i]->Clsid = This->RegFilters[i].Clsid; + ppRegFilter[i]->Clsid = This->RegFilters[This->uIndex + i].Clsid; ppRegFilter[i]->Name = (WCHAR*)((char*)ppRegFilter[i]+sizeof(REGFILTER)); - CopyMemory(ppRegFilter[i]->Name, This->RegFilters[i].Name, (strlenW(This->RegFilters[i].Name)+1)*sizeof(WCHAR)); + CopyMemory(ppRegFilter[i]->Name, This->RegFilters[This->uIndex + i].Name, + (strlenW(This->RegFilters[This->uIndex + i].Name)+1)*sizeof(WCHAR)); } This->uIndex += cFetched;
1
0
0
0
Alexander Dorofeyev : quartz: Fix accessing variant string.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: c782cdad96caad50942cb96f8bf82c754c6285e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c782cdad96caad50942cb96f8…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv> Date: Tue Jun 24 16:44:53 2008 +0300 quartz: Fix accessing variant string. --- dlls/quartz/filtermapper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index b54ccea..24055d6 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -1273,14 +1273,14 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( if (SUCCEEDED(hrSub)) { - len = (strlenW((WCHAR*)&V_UNION(&var, bstrVal))+1) * sizeof(WCHAR); + len = (strlenW((WCHAR*)V_UNION(&var, bstrVal))+1) * sizeof(WCHAR); if (!(regfilters[idx].Name = CoTaskMemAlloc(len*2))) hr = E_OUTOFMEMORY; } if (SUCCEEDED(hrSub)) { - memcpy(regfilters[idx].Name, &V_UNION(&var, bstrVal), len); + memcpy(regfilters[idx].Name, V_UNION(&var, bstrVal), len); regfilters[idx].Clsid = clsid; idx++; }
1
0
0
0
Vladimir Pankratov : hhctrl.ocx: Update Russian translation.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 2eee5fbfbe650541b3589f011bba2a589148f490 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2eee5fbfbe650541b3589f011…
Author: Vladimir Pankratov <scriptkid(a)mail.ru> Date: Tue Jun 24 15:41:32 2008 +0500 hhctrl.ocx: Update Russian translation. --- dlls/hhctrl.ocx/Ru.rc | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/hhctrl.ocx/Ru.rc b/dlls/hhctrl.ocx/Ru.rc index 4333033..a530f80 100644 --- a/dlls/hhctrl.ocx/Ru.rc +++ b/dlls/hhctrl.ocx/Ru.rc @@ -38,11 +38,11 @@ BEGIN IDTB_BACK "�����" IDTB_HOME "� ������" IDTB_SYNC "����������������" - IDTB_PRINT "������" + IDTB_PRINT "������" IDTB_OPTIONS "���������" - IDTB_FORWARD "� ����" + IDTB_FORWARD "�����" IDTB_NOTES "�������" - IDTB_BROWSE_FWD "�������� � ����" + IDTB_BROWSE_FWD "�������� �����" IDTB_BROWSE_BACK "�������� �����" IDTB_CONTENTS "����������" IDTB_INDEX "����������"
1
0
0
0
Alexandre Julliard : user32: Make sure that IsWindowVisible returns FALSE for HWND_MESSAGE windows.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 6536868d0771ab987b37d8a444ba8aaf71cd0389 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6536868d0771ab987b37d8a44…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 15:49:44 2008 +0200 user32: Make sure that IsWindowVisible returns FALSE for HWND_MESSAGE windows. --- dlls/user32/tests/win.c | 9 +++++++++ dlls/user32/win.c | 8 ++++---- server/window.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 3a3a152..cac34f7 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -4755,6 +4755,15 @@ static void test_hwnd_message(void) ok( found == hwnd, "didn't find message window %p/%p\n", found, hwnd ); } + /* test IsChild behavior */ + + if (parent) ok( !IsChild( parent, hwnd ), "HWND_MESSAGE is child of top window\n" ); + + /* test IsWindowVisible behavior */ + + ok( !IsWindowVisible( hwnd ), "HWND_MESSAGE window is visible\n" ); + if (parent) ok( !IsWindowVisible( parent ), "HWND_MESSAGE parent is visible\n" ); + DestroyWindow(hwnd); } diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 9a21246..9a97a3a 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2758,11 +2758,11 @@ BOOL WINAPI IsWindowVisible( HWND hwnd ) if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) return FALSE; if (!(list = list_window_parents( hwnd ))) return TRUE; - if (list[0] && list[1]) /* desktop window is considered always visible so we don't check it */ + if (list[0]) { for (i = 0; list[i+1]; i++) if (!(GetWindowLongW( list[i], GWL_STYLE ) & WS_VISIBLE)) break; - retval = !list[i+1]; + retval = !list[i+1] && (list[i] == GetDesktopWindow()); /* top message window isn't visible */ } HeapFree( GetProcessHeap(), 0, list ); return retval; @@ -2787,12 +2787,12 @@ BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL icon ) if ((style & WS_MINIMIZE) && icon && GetClassLongPtrW( hwnd, GCLP_HICON )) return FALSE; if (!(list = list_window_parents( hwnd ))) return TRUE; - if (list[0] && list[1]) /* desktop window is considered always visible so we don't check it */ + if (list[0]) { for (i = 0; list[i+1]; i++) if ((GetWindowLongW( list[i], GWL_STYLE ) & (WS_VISIBLE|WS_MINIMIZE)) != WS_VISIBLE) break; - retval = !list[i+1]; + retval = !list[i+1] && (list[i] == GetDesktopWindow()); /* top message window isn't visible */ } HeapFree( GetProcessHeap(), 0, list ); return retval; diff --git a/server/window.c b/server/window.c index ed8f042..303a6cf 100644 --- a/server/window.c +++ b/server/window.c @@ -604,7 +604,7 @@ static inline void inc_window_paint_count( struct window *win, int incr ) /* check if window and all its ancestors are visible */ static int is_visible( const struct window *win ) { - while (win && win->parent) + while (win) { if (!(win->style & WS_VISIBLE)) return 0; win = win->parent;
1
0
0
0
Alexandre Julliard : user32: Add support for finding HWND_MESSAGE windows in FindWindowEx.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 612c0104312e81c21b0a1216edd181cd46687404 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=612c0104312e81c21b0a1216e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 15:30:22 2008 +0200 user32: Add support for finding HWND_MESSAGE windows in FindWindowEx. --- dlls/user32/tests/win.c | 14 +++++++++- dlls/user32/win.c | 9 +++++- server/window.c | 68 +++++++++++++++++++++++++++++++++-------------- 3 files changed, 69 insertions(+), 22 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 182a0b6..3a3a152 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -4709,7 +4709,7 @@ static void test_GetWindowModuleFileName(void) static void test_hwnd_message(void) { - HWND parent = 0, hwnd; + HWND parent = 0, hwnd, found; RECT rect; hwnd = CreateWindowExA(0, "MainWindowClass", "message window", WS_CAPTION | WS_VISIBLE, @@ -4743,6 +4743,18 @@ static void test_hwnd_message(void) ok( rect.left == 100 && rect.right == 300 && rect.top == 100 && rect.bottom == 300, "wrong window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); + /* test FindWindow behavior */ + + found = FindWindowExA( 0, 0, 0, "message window" ); + ok( found == hwnd, "didn't find message window %p/%p\n", found, hwnd ); + found = FindWindowExA( GetDesktopWindow(), 0, 0, "message window" ); + ok( found == 0, "found message window %p/%p\n", found, hwnd ); + if (parent) + { + found = FindWindowExA( parent, 0, 0, "message window" ); + ok( found == hwnd, "didn't find message window %p/%p\n", found, hwnd ); + } + DestroyWindow(hwnd); } diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 3ba4d76..9a21246 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1578,7 +1578,9 @@ HWND WINAPI FindWindowExW( HWND parent, HWND child, LPCWSTR className, LPCWSTR t int i = 0, len = 0; WCHAR *buffer = NULL; - if (!parent) parent = GetDesktopWindow(); + if (!parent && child) parent = GetDesktopWindow(); + else if (parent == HWND_MESSAGE) parent = get_hwnd_message_parent(); + if (title) { len = strlenW(title) + 1; /* one extra char to check for chars beyond the end */ @@ -2940,6 +2942,11 @@ HWND WINAPI GetLastActivePopup( HWND hwnd ) */ HWND *WIN_ListChildren( HWND hwnd ) { + if (!hwnd) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return NULL; + } return list_window_children( 0, hwnd, NULL, 0 ); } diff --git a/server/window.c b/server/window.c index 53ea59f..ed8f042 100644 --- a/server/window.c +++ b/server/window.c @@ -639,6 +639,29 @@ static inline int is_point_in_window( struct window *win, int x, int y ) return 1; } +/* fill an array with the handles of the children of a specified window */ +static unsigned int get_children_windows( struct window *parent, atom_t atom, thread_id_t tid, + user_handle_t *handles, unsigned int max_count ) +{ + struct window *ptr; + unsigned int count = 0; + + if (!parent) return 0; + + LIST_FOR_EACH_ENTRY( ptr, &parent->children, struct window, entry ) + { + if (atom && get_class_atom(ptr->class) != atom) continue; + if (tid && get_thread_id(ptr->thread) != tid) continue; + if (handles) + { + if (count >= max_count) break; + handles[count] = ptr->handle; + } + count++; + } + return count; +} + /* find child of 'parent' that contains the given point (in parent-relative coords) */ static struct window *child_window_from_point( struct window *parent, int x, int y ) { @@ -1932,46 +1955,51 @@ DECL_HANDLER(get_window_parents) /* get a list of the window children */ DECL_HANDLER(get_window_children) { - struct window *ptr, *parent; - int total = 0; + struct window *parent = NULL; + unsigned int total; user_handle_t *data; data_size_t len; struct unicode_str cls_name; atom_t atom = req->atom; + struct desktop *desktop = NULL; if (req->desktop) { - struct desktop *desktop = get_desktop_obj( current->process, req->desktop, DESKTOP_ENUMERATE ); - if (!desktop) return; + if (!(desktop = get_desktop_obj( current->process, req->desktop, DESKTOP_ENUMERATE ))) return; parent = desktop->top_window; - release_object( desktop ); } - else parent = get_window( req->parent ); - - if (!parent) return; + else + { + if (req->parent && !(parent = get_window( req->parent ))) return; + if (!parent && !(desktop = get_thread_desktop( current, 0 ))) return; + } get_req_unicode_str( &cls_name ); if (cls_name.len && !(atom = find_global_atom( NULL, &cls_name ))) return; - LIST_FOR_EACH_ENTRY( ptr, &parent->children, struct window, entry ) - { - if (atom && get_class_atom(ptr->class) != atom) continue; - if (req->tid && get_thread_id(ptr->thread) != req->tid) continue; - total++; - } + if (parent) + total = get_children_windows( parent, atom, req->tid, NULL, 0 ); + else + total = get_children_windows( desktop->top_window, atom, req->tid, NULL, 0 ) + + get_children_windows( desktop->msg_window, atom, req->tid, NULL, 0 ); + reply->count = total; len = min( get_reply_max_size(), total * sizeof(user_handle_t) ); if (len && ((data = set_reply_data_size( len )))) { - LIST_FOR_EACH_ENTRY( ptr, &parent->children, struct window, entry ) + if (parent) get_children_windows( parent, atom, req->tid, data, len / sizeof(user_handle_t) ); + else { - if (len < sizeof(*data)) break; - if (atom && get_class_atom(ptr->class) != atom) continue; - if (req->tid && get_thread_id(ptr->thread) != req->tid) continue; - *data++ = ptr->handle; - len -= sizeof(*data); + total = get_children_windows( desktop->top_window, atom, req->tid, + data, len / sizeof(user_handle_t) ); + data += total; + len -= total * sizeof(user_handle_t); + if (len >= sizeof(user_handle_t)) + get_children_windows( desktop->msg_window, atom, req->tid, + data, len / sizeof(user_handle_t) ); } } + if (desktop) release_object( desktop ); }
1
0
0
0
Alexandre Julliard : user32/tests: Add some more tests for HWND_MESSAGE windows.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 9b9dbb20f2f173571ad40c79f4191dff206d40af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b9dbb20f2f173571ad40c79f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 15:24:02 2008 +0200 user32/tests: Add some more tests for HWND_MESSAGE windows. --- dlls/user32/tests/win.c | 58 +++++++++++++++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 17 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 68d5530..182a0b6 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -4707,27 +4707,51 @@ static void test_GetWindowModuleFileName(void) ok(!ret1, "expected 0, got %u\n", ret1); } +static void test_hwnd_message(void) +{ + HWND parent = 0, hwnd; + RECT rect; + + hwnd = CreateWindowExA(0, "MainWindowClass", "message window", WS_CAPTION | WS_VISIBLE, + 100, 100, 200, 200, HWND_MESSAGE, 0, 0, NULL); + if (!hwnd) + { + win_skip("CreateWindowExA with parent HWND_MESSAGE failed\n"); + return; + } + + ok( !GetParent(hwnd), "GetParent should return 0 for message only windows\n" ); + if (pGetAncestor) + { + char buffer[100]; + HWND root, desktop = GetDesktopWindow(); + + parent = pGetAncestor(hwnd, GA_PARENT); + ok(parent != 0, "GetAncestor(GA_PARENT) should not return 0 for message windows\n"); + ok(parent != desktop, "GetAncestor(GA_PARENT) should not return desktop for message windows\n"); + root = pGetAncestor(hwnd, GA_ROOT); + ok(root == hwnd, "GetAncestor(GA_ROOT) should return hwnd for message windows\n"); + ok( !pGetAncestor(parent, GA_PARENT), "parent shouldn't have a parent\n" ); + trace("parent %p root %p desktop %p\n", parent, root, desktop); + if (!GetClassNameA( parent, buffer, sizeof(buffer) )) buffer[0] = 0; + ok( !lstrcmpi( buffer, "Message" ), "wrong parent class '%s'\n", buffer ); + GetWindowRect( parent, &rect ); + ok( rect.left == 0 && rect.right == 100 && rect.top == 0 && rect.bottom == 100, + "wrong parent rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); + } + GetWindowRect( hwnd, &rect ); + ok( rect.left == 100 && rect.right == 300 && rect.top == 100 && rect.bottom == 300, + "wrong window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); + + DestroyWindow(hwnd); +} + START_TEST(win) { pGetAncestor = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetAncestor" ); pGetWindowInfo = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetWindowInfo" ); pGetWindowModuleFileNameA = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetWindowModuleFileNameA" ); - hwndMain = CreateWindowExA(0, "static", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, NULL); - if (hwndMain) - { - ok(!GetParent(hwndMain), "GetParent should return 0 for message only windows\n"); - if (pGetAncestor) - { - hwndMessage = pGetAncestor(hwndMain, GA_PARENT); - ok(hwndMessage != 0, "GetAncestor(GA_PARENT) should not return 0 for message only windows\n"); - trace("hwndMessage %p\n", hwndMessage); - } - DestroyWindow(hwndMain); - } - else - trace("CreateWindowExA with parent HWND_MESSAGE failed\n"); - if (!RegisterWindowClasses()) assert(0); hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId()); @@ -4738,8 +4762,6 @@ START_TEST(win) WS_MAXIMIZEBOX | WS_POPUP, 100, 100, 200, 200, 0, 0, GetModuleHandle(0), NULL); - test_nonclient_area(hwndMain); - hwndMain2 = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window 2", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, @@ -4751,6 +4773,8 @@ START_TEST(win) our_pid = GetWindowThreadProcessId(hwndMain, NULL); /* Add the tests below this line */ + test_hwnd_message(); + test_nonclient_area(hwndMain); test_params(); test_GetWindowModuleFileName(); test_capture_1();
1
0
0
0
Alexandre Julliard : user32: Treat the top-level message window as a desktop window.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 782403085f98423250c9286f7104c0191eb27234 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=782403085f98423250c9286f7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 15:20:26 2008 +0200 user32: Treat the top-level message window as a desktop window. --- dlls/user32/dialog.c | 2 +- dlls/user32/focus.c | 1 + dlls/user32/message.c | 10 ++++---- dlls/user32/win.c | 53 ++++++++++++++++++++++++++++++++++++++---------- dlls/user32/win.h | 2 + dlls/user32/winpos.c | 2 +- 6 files changed, 52 insertions(+), 18 deletions(-) diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index a9867c6..444a73d 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -1085,7 +1085,7 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg ) if (CallMsgFilterW( msg, MSGF_DIALOGBOX )) return TRUE; hwndDlg = WIN_GetFullHandle( hwndDlg ); - if (hwndDlg == GetDesktopWindow()) return FALSE; + if (is_desktop_window(hwndDlg)) return FALSE; if ((hwndDlg != msg->hwnd) && !IsChild( hwndDlg, msg->hwnd )) return FALSE; hwndDlg = DIALOG_FindMsgDestination(hwndDlg); diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 2eb1496..3253a87 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -264,6 +264,7 @@ HWND WINAPI SetFocus( HWND hwnd ) if (style & (WS_MINIMIZE | WS_DISABLED)) return 0; parent = GetAncestor( hwndTop, GA_PARENT ); if (!parent || parent == GetDesktopWindow()) break; + if (parent == get_hwnd_message_parent()) return 0; hwndTop = parent; } diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 19b3935..6588f8e 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1281,21 +1281,21 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR case WM_WINE_DESTROYWINDOW: return WIN_DestroyWindow( hwnd ); case WM_WINE_SETWINDOWPOS: - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; return USER_SetWindowPos( (WINDOWPOS *)lparam ); case WM_WINE_SHOWWINDOW: - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; return ShowWindow( hwnd, wparam ); case WM_WINE_SETPARENT: - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; return (LRESULT)SetParent( hwnd, (HWND)wparam ); case WM_WINE_SETWINDOWLONG: return WIN_SetWindowLong( hwnd, (short)LOWORD(wparam), HIWORD(wparam), lparam, TRUE ); case WM_WINE_ENABLEWINDOW: - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; return EnableWindow( hwnd, wparam ); case WM_WINE_SETACTIVEWINDOW: - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; return (LRESULT)SetActiveWindow( (HWND)wparam ); case WM_WINE_KEYBOARD_LL_HOOK: case WM_WINE_MOUSE_LL_HOOK: diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 3e65a2f..3ba4d76 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -362,7 +362,7 @@ static void get_server_window_text( HWND hwnd, LPWSTR text, INT count ) * * Return the parent for HWND_MESSAGE windows. */ -static HWND get_hwnd_message_parent(void) +HWND get_hwnd_message_parent(void) { struct user_thread_info *thread_info = get_user_thread_info(); @@ -371,6 +371,28 @@ static HWND get_hwnd_message_parent(void) } +/******************************************************************* + * is_desktop_window + * + * Check if window is the desktop or the HWND_MESSAGE top parent. + */ +BOOL is_desktop_window( HWND hwnd ) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + + if (!hwnd) return FALSE; + if (hwnd == thread_info->top_window) return TRUE; + if (hwnd == thread_info->msg_window) return TRUE; + + if (!HIWORD(hwnd) || HIWORD(hwnd) == 0xffff) + { + if (LOWORD(thread_info->top_window) == LOWORD(hwnd)) return TRUE; + if (LOWORD(thread_info->msg_window) == LOWORD(hwnd)) return TRUE; + } + return FALSE; +} + + /*********************************************************************** * WIN_GetPtr * @@ -393,11 +415,7 @@ WND *WIN_GetPtr( HWND hwnd ) return ptr; ptr = NULL; } - else if (index == USER_HANDLE_TO_INDEX(GetDesktopWindow())) - { - if (hwnd == GetDesktopWindow() || !HIWORD(hwnd) || HIWORD(hwnd) == 0xffff) ptr = WND_DESKTOP; - else ptr = NULL; - } + else if (is_desktop_window( hwnd )) ptr = WND_DESKTOP; else ptr = WND_OTHER_PROCESS; USER_Unlock(); return ptr; @@ -454,7 +472,11 @@ HWND WIN_Handle32( HWND16 hwnd16 ) if (!(ptr = WIN_GetPtr( hwnd ))) return hwnd; - if (ptr == WND_DESKTOP) return GetDesktopWindow(); + if (ptr == WND_DESKTOP) + { + if (LOWORD(hwnd) == LOWORD(GetDesktopWindow())) return GetDesktopWindow(); + else return get_hwnd_message_parent(); + } if (ptr != WND_OTHER_PROCESS) { @@ -569,8 +591,16 @@ BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient ) { RECT rect; rect.left = rect.top = 0; - rect.right = GetSystemMetrics(SM_CXSCREEN); - rect.bottom = GetSystemMetrics(SM_CYSCREEN); + if (hwnd == get_hwnd_message_parent()) + { + rect.right = 100; + rect.bottom = 100; + } + else + { + rect.right = GetSystemMetrics(SM_CXSCREEN); + rect.bottom = GetSystemMetrics(SM_CYSCREEN); + } if (rectWindow) *rectWindow = rect; if (rectClient) *rectClient = rect; } @@ -1431,7 +1461,7 @@ BOOL WINAPI DestroyWindow( HWND hwnd ) { BOOL is_child; - if (!(hwnd = WIN_IsCurrentThread( hwnd )) || (hwnd == GetDesktopWindow())) + if (!(hwnd = WIN_IsCurrentThread( hwnd )) || is_desktop_window( hwnd )) { SetLastError( ERROR_ACCESS_DENIED ); return FALSE; @@ -2609,7 +2639,8 @@ HWND WINAPI GetAncestor( HWND hwnd, UINT type ) break; case GA_ROOTOWNER: - if ((ret = WIN_GetFullHandle( hwnd )) == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; + ret = WIN_GetFullHandle( hwnd ); for (;;) { HWND parent = GetParent( ret ); diff --git a/dlls/user32/win.h b/dlls/user32/win.h index 5e7a67e..bc024f4 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -76,6 +76,8 @@ typedef struct tagWND #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ /* Window functions */ +extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN; +extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN; extern WND *WIN_GetPtr( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND WIN_Handle32( HWND16 hwnd16 ) DECLSPEC_HIDDEN; extern HWND WIN_IsCurrentProcess( HWND hwnd ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index aeea354..7398152 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -2100,7 +2100,7 @@ HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter, hdwp, hwnd, hwndAfter, x, y, cx, cy, flags); hwnd = WIN_GetFullHandle( hwnd ); - if (hwnd == GetDesktopWindow()) return 0; + if (is_desktop_window( hwnd )) return 0; if (!(pDWP = USER_HEAP_LIN_ADDR( hdwp ))) return 0;
1
0
0
0
Alexandre Julliard : user32: Use the top-level message window as parent for HWND_MESSAGE windows.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 1abbe0dfe33d3c3ce63004913a9d37cfa02d10ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1abbe0dfe33d3c3ce63004913…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 15:10:42 2008 +0200 user32: Use the top-level message window as parent for HWND_MESSAGE windows. --- dlls/user32/win.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index a924fe3..3e65a2f 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -357,6 +357,20 @@ static void get_server_window_text( HWND hwnd, LPWSTR text, INT count ) } +/******************************************************************* + * get_hwnd_message_parent + * + * Return the parent for HWND_MESSAGE windows. + */ +static HWND get_hwnd_message_parent(void) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + + if (!thread_info->msg_window) GetDesktopWindow(); /* trigger creation */ + return thread_info->msg_window; +} + + /*********************************************************************** * WIN_GetPtr * @@ -969,11 +983,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags if (cs->hwndParent == HWND_MESSAGE) { - /* native ole32.OleInitialize uses HWND_MESSAGE to create the - * message window (style: WS_POPUP|WS_DISABLED) - */ - FIXME("Parent is HWND_MESSAGE\n"); - parent = GetDesktopWindow(); + cs->hwndParent = parent = get_hwnd_message_parent(); } else if (cs->hwndParent) { @@ -2630,6 +2640,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent ) } if (!parent) parent = GetDesktopWindow(); + else if (parent == HWND_MESSAGE) parent = get_hwnd_message_parent(); else parent = WIN_GetFullHandle( parent ); if (!IsWindow( parent ))
1
0
0
0
Alexandre Julliard : explorer.exe: Create the top-level message window along with the desktop window.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 966cf7c86e72c456bd7f149bc37265389055e819 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=966cf7c86e72c456bd7f149bc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 25 14:49:33 2008 +0200 explorer.exe: Create the top-level message window along with the desktop window. --- programs/explorer/desktop.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 246e14b..552d11b 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -230,8 +230,9 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) void manage_desktop( WCHAR *arg ) { static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0}; + static const WCHAR messageW[] = {'M','e','s','s','a','g','e',0}; MSG msg; - HWND hwnd; + HWND hwnd, msg_hwnd; unsigned long xwin = 0; unsigned int width, height; WCHAR *cmdline = NULL; @@ -293,6 +294,11 @@ void manage_desktop( WCHAR *arg ) GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0, 0, 0, NULL ); + + /* create the HWND_MESSAGE parent */ + msg_hwnd = CreateWindowExW( 0, messageW, NULL, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + 0, 0, 100, 100, 0, 0, 0, NULL ); + if (hwnd == GetDesktopWindow()) { SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)desktop_wnd_proc ); @@ -309,6 +315,8 @@ void manage_desktop( WCHAR *arg ) hwnd = 0; } + if (GetAncestor( msg_hwnd, GA_PARENT )) DestroyWindow( msg_hwnd ); /* someone beat us to it */ + /* if we have a command line, execute it */ if (cmdline) {
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200