2021-09-29 12:08:05 +00:00
|
|
|
/*
|
|
|
|
* Unix call wrappers
|
|
|
|
*
|
|
|
|
* Copyright 2021 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_WIN32U_PRIVATE
|
|
|
|
#define __WINE_WIN32U_PRIVATE
|
|
|
|
|
2021-11-08 13:48:28 +00:00
|
|
|
#include <stdarg.h>
|
2022-03-02 14:06:33 +00:00
|
|
|
#include <stdlib.h>
|
2021-11-08 13:48:28 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "ntgdi.h"
|
|
|
|
#include "ntuser.h"
|
2021-10-06 14:20:35 +00:00
|
|
|
#include "wine/gdi_driver.h"
|
|
|
|
#include "wine/unixlib.h"
|
2021-11-08 13:48:28 +00:00
|
|
|
#include "wine/debug.h"
|
2022-05-15 20:56:29 +00:00
|
|
|
#include "wine/server.h"
|
2021-09-29 12:08:05 +00:00
|
|
|
|
2021-09-29 12:09:21 +00:00
|
|
|
|
2022-03-17 15:29:30 +00:00
|
|
|
/* clipboard.c */
|
2022-04-22 12:46:17 +00:00
|
|
|
extern UINT enum_clipboard_formats( UINT format ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:30 +00:00
|
|
|
extern void release_clipboard_owner( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
|
2022-02-14 13:07:34 +00:00
|
|
|
/* cursoricon.c */
|
2023-06-10 10:52:01 +00:00
|
|
|
extern BOOL process_wine_setcursor( HWND hwnd, HWND window, HCURSOR handle ) DECLSPEC_HIDDEN;
|
2022-02-22 12:53:11 +00:00
|
|
|
extern HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN;
|
2022-02-24 00:27:36 +00:00
|
|
|
extern ULONG_PTR get_icon_param( HICON handle ) DECLSPEC_HIDDEN;
|
|
|
|
extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) DECLSPEC_HIDDEN;
|
2022-02-14 13:07:34 +00:00
|
|
|
|
2022-03-14 10:45:01 +00:00
|
|
|
/* dce.c */
|
|
|
|
extern struct window_surface dummy_surface DECLSPEC_HIDDEN;
|
2022-03-21 13:13:56 +00:00
|
|
|
extern BOOL create_dib_surface( HDC hdc, const BITMAPINFO *info ) DECLSPEC_HIDDEN;
|
2022-03-18 13:28:42 +00:00
|
|
|
extern void create_offscreen_window_surface( const RECT *visible_rect,
|
|
|
|
struct window_surface **surface ) DECLSPEC_HIDDEN;
|
2022-03-18 13:27:55 +00:00
|
|
|
extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
|
2022-03-14 10:45:01 +00:00
|
|
|
extern void flush_window_surfaces( BOOL idle ) DECLSPEC_HIDDEN;
|
2022-03-18 13:28:42 +00:00
|
|
|
extern void move_window_bits( HWND hwnd, struct window_surface *old_surface,
|
|
|
|
struct window_surface *new_surface,
|
|
|
|
const RECT *visible_rect, const RECT *old_visible_rect,
|
|
|
|
const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN;
|
|
|
|
extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect,
|
|
|
|
const RECT *valid_rects ) DECLSPEC_HIDDEN;
|
2022-03-14 10:45:01 +00:00
|
|
|
extern void register_window_surface( struct window_surface *old,
|
|
|
|
struct window_surface *new ) DECLSPEC_HIDDEN;
|
|
|
|
|
2022-04-07 13:24:55 +00:00
|
|
|
/* defwnd.c */
|
|
|
|
extern LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
|
|
|
|
BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-05-19 12:23:17 +00:00
|
|
|
extern LRESULT desktop_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
|
2022-10-23 09:58:41 +00:00
|
|
|
extern BOOL draw_menu_button( HWND hwnd, HDC dc, RECT *r, enum NONCLIENT_BUTTON_TYPE, BOOL down, BOOL grayed ) DECLSPEC_HIDDEN;
|
2022-06-10 18:15:53 +00:00
|
|
|
extern BOOL draw_frame_menu( HDC dc, RECT *r, UINT flags ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL draw_nc_sys_button( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL draw_rect_edge( HDC hdc, RECT *rc, UINT uType, UINT uFlags, UINT width ) DECLSPEC_HIDDEN;
|
2022-05-11 19:00:01 +00:00
|
|
|
extern void fill_rect( HDC dc, const RECT *rect, HBRUSH hbrush ) DECLSPEC_HIDDEN;
|
2022-06-12 14:52:40 +00:00
|
|
|
extern void get_sys_popup_pos( HWND hwnd, RECT *rect ) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT handle_nc_hit_test( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
|
2022-04-07 13:24:55 +00:00
|
|
|
|
2022-02-16 11:31:17 +00:00
|
|
|
/* hook.c */
|
2022-02-25 15:02:12 +00:00
|
|
|
extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
|
2022-08-16 10:35:09 +00:00
|
|
|
extern LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam,
|
|
|
|
size_t lparam_size ) DECLSPEC_HIDDEN;
|
2023-07-19 14:22:32 +00:00
|
|
|
extern LRESULT call_message_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam,
|
|
|
|
size_t lparam_size, size_t message_size, BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-07-19 17:19:56 +00:00
|
|
|
extern BOOL is_hooked( INT id ) DECLSPEC_HIDDEN;
|
2022-02-16 11:31:17 +00:00
|
|
|
extern BOOL unhook_windows_hook( INT id, HOOKPROC proc ) DECLSPEC_HIDDEN;
|
|
|
|
|
2022-07-08 18:09:26 +00:00
|
|
|
/* imm.c */
|
2022-07-08 23:17:54 +00:00
|
|
|
extern void cleanup_imm_thread(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HWND get_default_ime_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-07-08 18:09:26 +00:00
|
|
|
extern HIMC get_default_input_context(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HIMC get_window_input_context( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-07-08 23:17:54 +00:00
|
|
|
extern BOOL register_imm_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
extern void unregister_imm_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-07-08 18:09:26 +00:00
|
|
|
|
2022-02-14 13:08:27 +00:00
|
|
|
/* input.c */
|
2023-06-08 06:44:31 +00:00
|
|
|
extern BOOL grab_pointer DECLSPEC_HIDDEN;
|
2023-06-08 06:51:47 +00:00
|
|
|
extern BOOL grab_fullscreen DECLSPEC_HIDDEN;
|
2022-04-26 15:06:04 +00:00
|
|
|
extern BOOL destroy_caret(void) DECLSPEC_HIDDEN;
|
2022-02-15 12:15:56 +00:00
|
|
|
extern LONG global_key_state_counter DECLSPEC_HIDDEN;
|
2022-03-09 14:22:39 +00:00
|
|
|
extern HWND get_active_window(void) DECLSPEC_HIDDEN;
|
2022-04-20 13:57:42 +00:00
|
|
|
extern HWND get_capture(void) DECLSPEC_HIDDEN;
|
2022-02-14 13:08:27 +00:00
|
|
|
extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:32 +00:00
|
|
|
extern HWND get_focus(void) DECLSPEC_HIDDEN;
|
2022-02-15 12:10:51 +00:00
|
|
|
extern DWORD get_input_state(void) DECLSPEC_HIDDEN;
|
2023-05-31 10:52:51 +00:00
|
|
|
extern BOOL release_capture(void) DECLSPEC_HIDDEN;
|
2022-03-11 13:22:19 +00:00
|
|
|
extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN;
|
2022-04-26 15:06:04 +00:00
|
|
|
extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL set_caret_pos( int x, int y ) DECLSPEC_HIDDEN;
|
2022-03-11 13:22:04 +00:00
|
|
|
extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN;
|
2022-04-26 15:06:04 +00:00
|
|
|
extern void toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-04-26 15:06:02 +00:00
|
|
|
extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
|
2023-05-26 20:04:20 +00:00
|
|
|
extern BOOL get_clip_cursor( RECT *rect ) DECLSPEC_HIDDEN;
|
2023-06-16 06:54:43 +00:00
|
|
|
extern BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) DECLSPEC_HIDDEN;
|
2023-06-08 06:51:47 +00:00
|
|
|
extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
|
2022-02-14 13:08:27 +00:00
|
|
|
|
2022-03-17 15:29:31 +00:00
|
|
|
/* menu.c */
|
2022-04-15 12:52:51 +00:00
|
|
|
extern HMENU create_menu( BOOL is_popup ) DECLSPEC_HIDDEN;
|
2022-04-15 12:53:43 +00:00
|
|
|
extern BOOL draw_menu_bar( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-12 14:52:40 +00:00
|
|
|
extern UINT draw_nc_menu_bar( HDC hdc, RECT *rect, HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
extern void end_menu( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:31 +00:00
|
|
|
extern HMENU get_menu( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-10 16:23:21 +00:00
|
|
|
extern UINT get_menu_bar_height( HWND hwnd, UINT width, INT org_x, INT org_y ) DECLSPEC_HIDDEN;
|
2022-04-20 13:58:00 +00:00
|
|
|
extern BOOL get_menu_info( HMENU handle, MENUINFO *info ) DECLSPEC_HIDDEN;
|
2022-04-14 14:28:06 +00:00
|
|
|
extern INT get_menu_item_count( HMENU handle ) DECLSPEC_HIDDEN;
|
2022-06-10 13:52:01 +00:00
|
|
|
extern UINT get_menu_state( HMENU handle, UINT item_id, UINT flags ) DECLSPEC_HIDDEN;
|
2022-07-28 17:21:53 +00:00
|
|
|
extern HMENU get_window_sys_sub_menu( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-10 18:27:33 +00:00
|
|
|
extern BOOL is_menu( HMENU handle ) DECLSPEC_HIDDEN;
|
2022-06-11 00:39:41 +00:00
|
|
|
extern HWND is_menu_active(void) DECLSPEC_HIDDEN;
|
2022-06-10 23:42:50 +00:00
|
|
|
extern LRESULT popup_menu_window_proc( HWND hwnd, UINT message, WPARAM wparam,
|
|
|
|
LPARAM lparam ) DECLSPEC_HIDDEN;
|
2022-04-20 13:57:42 +00:00
|
|
|
extern BOOL set_window_menu( HWND hwnd, HMENU handle ) DECLSPEC_HIDDEN;
|
2022-06-12 14:52:40 +00:00
|
|
|
extern void track_keyboard_menu_bar( HWND hwnd, UINT wparam, WCHAR ch ) DECLSPEC_HIDDEN;
|
|
|
|
extern void track_mouse_menu_bar( HWND hwnd, INT ht, int x, int y ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:31 +00:00
|
|
|
|
2022-03-09 14:19:47 +00:00
|
|
|
/* message.c */
|
2022-03-16 14:36:42 +00:00
|
|
|
extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) DECLSPEC_HIDDEN;
|
2022-08-12 11:01:38 +00:00
|
|
|
extern BOOL reply_message_result( LRESULT result ) DECLSPEC_HIDDEN;
|
2022-04-01 12:46:58 +00:00
|
|
|
extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput,
|
|
|
|
UINT flags ) DECLSPEC_HIDDEN;
|
2022-04-01 12:46:51 +00:00
|
|
|
extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UINT msg, WPARAM wparam,
|
|
|
|
LPARAM lparam, UINT flags, UINT timeout,
|
|
|
|
PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
|
2022-03-09 14:19:47 +00:00
|
|
|
extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
|
2022-10-13 19:17:54 +00:00
|
|
|
extern BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-04-04 14:57:43 +00:00
|
|
|
extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
|
2023-01-19 01:50:38 +00:00
|
|
|
UINT flags, UINT timeout, BOOL ansi ) DECLSPEC_HIDDEN;
|
2023-07-18 18:34:57 +00:00
|
|
|
extern size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,
|
2023-07-17 21:43:19 +00:00
|
|
|
BOOL other_process, BOOL ansi ) DECLSPEC_HIDDEN;
|
2023-07-18 11:19:43 +00:00
|
|
|
extern void pack_user_message( void *buffer, size_t size, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam, BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-03-09 14:19:47 +00:00
|
|
|
|
2022-05-15 20:56:29 +00:00
|
|
|
/* rawinput.c */
|
|
|
|
extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) DECLSPEC_HIDDEN;
|
2022-05-15 23:25:56 +00:00
|
|
|
extern BOOL rawinput_device_get_usages( HANDLE handle, USHORT *usage_page, USHORT *usage ) DECLSPEC_HIDDEN;
|
2022-05-15 20:56:29 +00:00
|
|
|
|
2022-06-28 18:52:31 +00:00
|
|
|
/* scroll.c */
|
2022-06-30 15:12:46 +00:00
|
|
|
extern void draw_nc_scrollbar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL get_scroll_info( HWND hwnd, INT bar, SCROLLINFO *info ) DECLSPEC_HIDDEN;
|
|
|
|
extern void handle_scroll_event( HWND hwnd, INT bar, UINT msg, POINT pt ) DECLSPEC_HIDDEN;
|
2022-06-28 18:52:31 +00:00
|
|
|
extern LRESULT scroll_bar_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
|
|
|
|
BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-06-28 19:03:24 +00:00
|
|
|
extern void set_standard_scroll_painted( HWND hwnd, int bar, BOOL painted ) DECLSPEC_HIDDEN;
|
2022-06-30 15:12:46 +00:00
|
|
|
extern void track_scroll_bar( HWND hwnd, int scrollbar, POINT pt ) DECLSPEC_HIDDEN;
|
2022-06-28 18:52:31 +00:00
|
|
|
|
2022-02-14 13:07:34 +00:00
|
|
|
/* sysparams.c */
|
2022-03-31 13:36:51 +00:00
|
|
|
extern BOOL enable_thunk_lock DECLSPEC_HIDDEN;
|
2022-06-10 13:52:01 +00:00
|
|
|
extern HBRUSH get_55aa_brush(void) DECLSPEC_HIDDEN;
|
2022-06-10 16:23:21 +00:00
|
|
|
extern DWORD get_dialog_base_units(void) DECLSPEC_HIDDEN;
|
2022-11-23 15:02:56 +00:00
|
|
|
extern LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, int *height ) DECLSPEC_HIDDEN;
|
2023-01-03 14:38:09 +00:00
|
|
|
extern INT get_display_depth( UNICODE_STRING *name ) DECLSPEC_HIDDEN;
|
2021-12-06 02:16:10 +00:00
|
|
|
extern RECT get_display_rect( const WCHAR *display ) DECLSPEC_HIDDEN;
|
2022-02-14 13:07:25 +00:00
|
|
|
extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN;
|
2022-03-10 13:32:34 +00:00
|
|
|
extern BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) DECLSPEC_HIDDEN;
|
2022-03-09 14:22:07 +00:00
|
|
|
extern UINT get_win_monitor_dpi( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-09 14:22:22 +00:00
|
|
|
extern RECT get_primary_monitor_rect( UINT dpi ) DECLSPEC_HIDDEN;
|
2022-08-05 10:34:19 +00:00
|
|
|
extern DWORD get_process_layout(void) DECLSPEC_HIDDEN;
|
2022-06-10 13:52:01 +00:00
|
|
|
extern COLORREF get_sys_color( int index ) DECLSPEC_HIDDEN;
|
2022-05-16 11:57:38 +00:00
|
|
|
extern HBRUSH get_sys_color_brush( unsigned int index ) DECLSPEC_HIDDEN;
|
2022-06-10 13:52:01 +00:00
|
|
|
extern HPEN get_sys_color_pen( unsigned int index ) DECLSPEC_HIDDEN;
|
2021-12-06 02:10:15 +00:00
|
|
|
extern UINT get_system_dpi(void) DECLSPEC_HIDDEN;
|
2021-12-06 02:16:10 +00:00
|
|
|
extern int get_system_metrics( int index ) DECLSPEC_HIDDEN;
|
2022-02-14 13:07:25 +00:00
|
|
|
extern UINT get_thread_dpi(void) DECLSPEC_HIDDEN;
|
2022-03-18 13:27:55 +00:00
|
|
|
extern DPI_AWARENESS get_thread_dpi_awareness(void) DECLSPEC_HIDDEN;
|
2021-12-06 02:15:59 +00:00
|
|
|
extern RECT get_virtual_screen_rect( UINT dpi ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:30 +00:00
|
|
|
extern BOOL is_exiting_thread( DWORD tid ) DECLSPEC_HIDDEN;
|
2022-02-14 13:07:53 +00:00
|
|
|
extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
|
2022-02-14 13:07:25 +00:00
|
|
|
extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
|
2022-06-12 14:52:40 +00:00
|
|
|
extern BOOL message_beep( UINT i ) DECLSPEC_HIDDEN;
|
2022-03-31 13:36:39 +00:00
|
|
|
extern POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
|
2022-05-19 11:12:33 +00:00
|
|
|
extern POINT point_thread_to_win_dpi( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
|
|
|
|
extern RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ) DECLSPEC_HIDDEN;
|
2022-11-23 15:02:16 +00:00
|
|
|
extern HMONITOR monitor_from_point( POINT pt, UINT flags, UINT dpi ) DECLSPEC_HIDDEN;
|
|
|
|
extern HMONITOR monitor_from_rect( const RECT *rect, UINT flags, UINT dpi ) DECLSPEC_HIDDEN;
|
|
|
|
extern HMONITOR monitor_from_window( HWND hwnd, UINT flags, UINT dpi ) DECLSPEC_HIDDEN;
|
2023-06-20 15:23:28 +00:00
|
|
|
extern BOOL update_display_cache( BOOL force ) DECLSPEC_HIDDEN;
|
2022-02-24 00:27:57 +00:00
|
|
|
extern void user_lock(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void user_unlock(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void user_check_not_lock(void) DECLSPEC_HIDDEN;
|
2021-12-02 00:14:12 +00:00
|
|
|
|
2023-06-08 06:51:47 +00:00
|
|
|
/* winstation.c */
|
|
|
|
extern BOOL is_virtual_desktop(void) DECLSPEC_HIDDEN;
|
|
|
|
|
2022-02-15 12:10:20 +00:00
|
|
|
/* window.c */
|
2022-02-24 00:27:57 +00:00
|
|
|
struct tagWND;
|
2022-03-15 13:27:28 +00:00
|
|
|
extern HDWP begin_defer_window_pos( INT count ) DECLSPEC_HIDDEN;
|
2022-06-20 11:58:48 +00:00
|
|
|
extern BOOL client_to_screen( HWND hwnd, POINT *pt ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:29 +00:00
|
|
|
extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:30 +00:00
|
|
|
extern LRESULT destroy_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-30 15:12:46 +00:00
|
|
|
extern BOOL enable_window( HWND hwnd, BOOL enable ) DECLSPEC_HIDDEN;
|
2022-03-17 15:29:32 +00:00
|
|
|
extern BOOL get_client_rect( HWND hwnd, RECT *rect ) DECLSPEC_HIDDEN;
|
2022-03-09 14:20:01 +00:00
|
|
|
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
|
2022-03-15 13:27:55 +00:00
|
|
|
extern UINT get_dpi_for_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-11 13:21:31 +00:00
|
|
|
extern HWND get_full_window_handle( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-04-06 09:10:45 +00:00
|
|
|
extern HWND get_parent( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-11 13:21:45 +00:00
|
|
|
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
|
2022-03-14 10:43:55 +00:00
|
|
|
extern DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-05-11 19:26:52 +00:00
|
|
|
extern MINMAXINFO get_min_max_info( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-11 00:39:41 +00:00
|
|
|
extern DWORD get_window_context_help_id( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-04-06 09:10:45 +00:00
|
|
|
extern HWND get_window_relative( HWND hwnd, UINT rel ) DECLSPEC_HIDDEN;
|
2022-03-11 13:21:31 +00:00
|
|
|
extern DWORD get_window_thread( HWND hwnd, DWORD *process ) DECLSPEC_HIDDEN;
|
2022-03-14 10:43:55 +00:00
|
|
|
extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-02-24 00:27:57 +00:00
|
|
|
extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-15 13:27:14 +00:00
|
|
|
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-10 13:32:34 +00:00
|
|
|
extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-08 17:15:14 +00:00
|
|
|
extern BOOL is_window_drawable( HWND hwnd, BOOL icon ) DECLSPEC_HIDDEN;
|
2022-04-07 13:26:39 +00:00
|
|
|
extern BOOL is_window_enabled( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-21 15:42:08 +00:00
|
|
|
extern BOOL is_window_unicode( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-06-08 19:25:00 +00:00
|
|
|
extern BOOL is_window_visible( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL is_zoomed( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-03-08 13:24:00 +00:00
|
|
|
extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
|
2022-06-10 23:42:50 +00:00
|
|
|
extern ULONG_PTR get_window_long_ptr( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-03-10 13:32:34 +00:00
|
|
|
extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN;
|
2022-03-14 10:43:55 +00:00
|
|
|
enum coords_relative;
|
|
|
|
extern BOOL get_window_rects( HWND hwnd, enum coords_relative relative, RECT *window_rect,
|
|
|
|
RECT *client_rect, UINT dpi ) DECLSPEC_HIDDEN;
|
2022-03-11 13:21:31 +00:00
|
|
|
extern HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *class,
|
|
|
|
DWORD tid ) DECLSPEC_HIDDEN;
|
2022-03-15 13:28:20 +00:00
|
|
|
extern int map_window_points( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count,
|
|
|
|
UINT dpi ) DECLSPEC_HIDDEN;
|
2022-03-14 10:45:43 +00:00
|
|
|
extern void map_window_region( HWND from, HWND to, HRGN hrgn ) DECLSPEC_HIDDEN;
|
2022-04-06 09:10:45 +00:00
|
|
|
extern BOOL screen_to_client( HWND hwnd, POINT *pt ) DECLSPEC_HIDDEN;
|
2022-03-16 14:35:25 +00:00
|
|
|
extern LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval,
|
|
|
|
BOOL ansi ) DECLSPEC_HIDDEN;
|
2022-03-15 13:27:14 +00:00
|
|
|
extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) DECLSPEC_HIDDEN;
|
2022-03-16 14:34:55 +00:00
|
|
|
extern ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
|
2022-04-15 12:54:16 +00:00
|
|
|
extern BOOL show_owned_popups( HWND owner, BOOL show ) DECLSPEC_HIDDEN;
|
2022-03-10 13:32:56 +00:00
|
|
|
extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-04-06 09:10:45 +00:00
|
|
|
extern HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
|
2023-05-26 20:03:34 +00:00
|
|
|
extern HWND get_shell_window(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HWND get_progman_window(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HWND set_progman_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
extern HWND get_taskman_window(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HWND set_taskman_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
2022-02-24 00:27:57 +00:00
|
|
|
|
|
|
|
/* to release pointers retrieved by win_get_ptr */
|
|
|
|
static inline void release_win_ptr( struct tagWND *ptr )
|
|
|
|
{
|
|
|
|
user_unlock();
|
|
|
|
}
|
2022-02-15 12:10:20 +00:00
|
|
|
|
2022-08-17 23:24:45 +00:00
|
|
|
extern void gdi_init(void) DECLSPEC_HIDDEN;
|
2021-10-14 13:22:40 +00:00
|
|
|
extern void winstation_init(void) DECLSPEC_HIDDEN;
|
2021-12-03 11:56:05 +00:00
|
|
|
extern void sysparams_init(void) DECLSPEC_HIDDEN;
|
2022-06-28 19:26:37 +00:00
|
|
|
extern int muldiv( int a, int b, int c ) DECLSPEC_HIDDEN;
|
2021-09-29 12:09:21 +00:00
|
|
|
|
2021-11-30 12:26:01 +00:00
|
|
|
extern HKEY reg_create_key( HKEY root, const WCHAR *name, ULONG name_len,
|
|
|
|
DWORD options, DWORD *disposition ) DECLSPEC_HIDDEN;
|
2021-10-14 13:22:40 +00:00
|
|
|
extern HKEY reg_open_hkcu_key( const char *name ) DECLSPEC_HIDDEN;
|
|
|
|
extern HKEY reg_open_key( HKEY root, const WCHAR *name, ULONG name_len ) DECLSPEC_HIDDEN;
|
2021-11-30 12:24:18 +00:00
|
|
|
extern ULONG query_reg_value( HKEY hkey, const WCHAR *name,
|
|
|
|
KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size ) DECLSPEC_HIDDEN;
|
2021-10-14 13:22:40 +00:00
|
|
|
extern ULONG query_reg_ascii_value( HKEY hkey, const char *name,
|
|
|
|
KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size ) DECLSPEC_HIDDEN;
|
2021-11-30 12:26:01 +00:00
|
|
|
extern void set_reg_ascii_value( HKEY hkey, const char *name, const char *value ) DECLSPEC_HIDDEN;
|
2021-12-06 02:08:45 +00:00
|
|
|
extern BOOL set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value,
|
2021-11-30 12:26:01 +00:00
|
|
|
DWORD count ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL reg_delete_tree( HKEY parent, const WCHAR *name, ULONG name_len ) DECLSPEC_HIDDEN;
|
2021-12-06 02:08:45 +00:00
|
|
|
extern void reg_delete_value( HKEY hkey, const WCHAR *name ) DECLSPEC_HIDDEN;
|
2021-09-29 12:09:21 +00:00
|
|
|
|
2021-12-03 11:56:05 +00:00
|
|
|
extern HKEY hkcu_key DECLSPEC_HIDDEN;
|
|
|
|
|
2021-11-11 13:13:45 +00:00
|
|
|
extern const struct user_driver_funcs *user_driver DECLSPEC_HIDDEN;
|
|
|
|
|
2023-07-03 16:40:44 +00:00
|
|
|
extern ULONG_PTR zero_bits DECLSPEC_HIDDEN;
|
|
|
|
|
2021-11-12 11:53:28 +00:00
|
|
|
static inline BOOL set_ntstatus( NTSTATUS status )
|
|
|
|
{
|
2022-08-09 19:49:50 +00:00
|
|
|
if (status) RtlSetLastWin32Error( RtlNtStatusToDosError( status ));
|
2021-11-12 11:53:28 +00:00
|
|
|
return !status;
|
|
|
|
}
|
|
|
|
|
2021-09-29 12:08:14 +00:00
|
|
|
static inline WCHAR win32u_towupper( WCHAR ch )
|
|
|
|
{
|
|
|
|
return RtlUpcaseUnicodeChar( ch );
|
|
|
|
}
|
|
|
|
|
2022-04-12 08:14:27 +00:00
|
|
|
extern CPTABLEINFO ansi_cp DECLSPEC_HIDDEN;
|
|
|
|
|
2022-12-20 12:53:04 +00:00
|
|
|
CPTABLEINFO *get_cptable( WORD cp ) DECLSPEC_HIDDEN;
|
|
|
|
const NLS_LOCALE_DATA *get_locale_data( LCID lcid ) DECLSPEC_HIDDEN;
|
2023-03-03 12:39:26 +00:00
|
|
|
extern BOOL translate_charset_info( DWORD *src, CHARSETINFO *cs, DWORD flags ) DECLSPEC_HIDDEN;
|
2022-04-07 13:24:25 +00:00
|
|
|
DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *src,
|
|
|
|
DWORD srclen ) DECLSPEC_HIDDEN;
|
|
|
|
DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *src,
|
|
|
|
DWORD srclen ) DECLSPEC_HIDDEN;
|
2022-06-20 15:58:21 +00:00
|
|
|
DWORD win32u_wctomb_size( CPTABLEINFO *info, const WCHAR *src, DWORD srclen ) DECLSPEC_HIDDEN;
|
2022-12-20 12:53:04 +00:00
|
|
|
DWORD win32u_mbtowc_size( CPTABLEINFO *info, const char *src, DWORD srclen ) DECLSPEC_HIDDEN;
|
2022-04-07 13:24:25 +00:00
|
|
|
|
|
|
|
static inline WCHAR *win32u_wcsdup( const WCHAR *str )
|
|
|
|
{
|
|
|
|
DWORD size = (lstrlenW( str ) + 1) * sizeof(WCHAR);
|
|
|
|
WCHAR *ret = malloc( size );
|
|
|
|
if (ret) memcpy( ret, str, size );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline WCHAR *towstr( const char *str )
|
|
|
|
{
|
|
|
|
DWORD len = strlen( str ) + 1;
|
2022-04-12 08:10:17 +00:00
|
|
|
WCHAR *ret = malloc( len * sizeof(WCHAR) );
|
2022-04-12 08:14:27 +00:00
|
|
|
if (ret) win32u_mbtowc( &ansi_cp, ret, len, str, len );
|
2022-04-07 13:24:25 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-09-29 12:08:14 +00:00
|
|
|
#define towupper(c) win32u_towupper(c)
|
2022-04-07 13:24:25 +00:00
|
|
|
#define wcsdup(s) win32u_wcsdup(s)
|
2021-09-29 12:08:14 +00:00
|
|
|
|
2021-10-14 13:22:40 +00:00
|
|
|
static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
|
|
|
|
{
|
|
|
|
while (len--) *dst++ = (unsigned char)*src++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline UINT asciiz_to_unicode( WCHAR *dst, const char *src )
|
|
|
|
{
|
|
|
|
WCHAR *p = dst;
|
|
|
|
while ((*p++ = *src++));
|
|
|
|
return (p - dst) * sizeof(WCHAR);
|
|
|
|
}
|
|
|
|
|
2021-11-17 11:49:37 +00:00
|
|
|
static inline BOOL is_win9x(void)
|
|
|
|
{
|
|
|
|
return NtCurrentTeb()->Peb->OSPlatformId == VER_PLATFORM_WIN32s;
|
|
|
|
}
|
|
|
|
|
2021-11-30 12:26:48 +00:00
|
|
|
static inline const char *debugstr_us( const UNICODE_STRING *us )
|
|
|
|
{
|
|
|
|
if (!us) return "<null>";
|
|
|
|
return debugstr_wn( us->Buffer, us->Length / sizeof(WCHAR) );
|
|
|
|
}
|
|
|
|
|
2022-11-23 11:02:51 +00:00
|
|
|
static inline const char *debugstr_color( COLORREF color )
|
|
|
|
{
|
|
|
|
if (color & (1 << 24)) /* PALETTEINDEX */
|
|
|
|
return wine_dbg_sprintf( "PALETTEINDEX(%u)", LOWORD(color) );
|
|
|
|
if (color >> 16 == 0x10ff) /* DIBINDEX */
|
|
|
|
return wine_dbg_sprintf( "DIBINDEX(%u)", LOWORD(color) );
|
|
|
|
return wine_dbg_sprintf( "RGB(%02x,%02x,%02x)", GetRValue(color), GetGValue(color), GetBValue(color) );
|
|
|
|
}
|
|
|
|
|
2023-06-08 06:51:47 +00:00
|
|
|
static inline BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2 )
|
|
|
|
{
|
|
|
|
dst->left = max( src1->left, src2->left );
|
|
|
|
dst->top = max( src1->top, src2->top );
|
|
|
|
dst->right = min( src1->right, src2->right );
|
|
|
|
dst->bottom = min( src1->bottom, src2->bottom );
|
|
|
|
return !IsRectEmpty( dst );
|
|
|
|
}
|
|
|
|
|
2021-09-29 12:08:05 +00:00
|
|
|
#endif /* __WINE_WIN32U_PRIVATE */
|