server: Add a more general way of posting messages to the desktop window.

This commit is contained in:
Alexandre Julliard 2011-03-31 20:25:45 +02:00
parent 437a838470
commit 85358b10f3
3 changed files with 7 additions and 5 deletions

View File

@ -143,7 +143,8 @@ extern int rect_in_region( struct region *region, const rectangle_t *rect );
extern struct process *get_top_window_owner( struct desktop *desktop );
extern void get_top_window_rectangle( struct desktop *desktop, rectangle_t *rect );
extern void close_desktop_window( struct desktop *desktop );
extern void post_desktop_message( struct desktop *desktop, unsigned int message,
lparam_t wparam, lparam_t lparam );
extern void destroy_window( struct window *win );
extern void destroy_thread_windows( struct thread *thread );
extern int is_child_window( user_handle_t parent, user_handle_t child );

View File

@ -402,11 +402,12 @@ void get_top_window_rectangle( struct desktop *desktop, rectangle_t *rect )
else *rect = win->window_rect;
}
/* attempt to close the desktop window when the last process using it is gone */
void close_desktop_window( struct desktop *desktop )
/* post a message to the desktop window */
void post_desktop_message( struct desktop *desktop, unsigned int message,
lparam_t wparam, lparam_t lparam )
{
struct window *win = desktop->top_window;
if (win && win->thread) post_message( win->handle, WM_CLOSE, 0, 0 );
if (win && win->thread) post_message( win->handle, message, wparam, lparam );
}
/* create a new window structure (note: the window is not linked in the window tree) */

View File

@ -376,7 +376,7 @@ static void close_desktop_timeout( void *private )
desktop->close_timeout = NULL;
unlink_named_object( &desktop->obj ); /* make sure no other process can open it */
close_desktop_window( desktop ); /* and signal the owner to quit */
post_desktop_message( desktop, WM_CLOSE, 0, 0 ); /* and signal the owner to quit */
}
/* close the desktop of a given process */