Windows.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /******************************************************************************
  2. Use 'WindowCapture' to capture visual contents of a system window.
  3. Use 'Window' functions to handle OS window management.
  4. /******************************************************************************/
  5. struct WindowCapture // System Window Image Capture
  6. {
  7. void del ( ); // delete manually
  8. Bool capture(Image &image, Ptr hwnd=null); // capture 'hwnd' window client screen to 'image' (use null for 'hwnd' to capture full desktop), false on fail
  9. ~WindowCapture() {del();}
  10. WindowCapture() {data=null;}
  11. private:
  12. Ptr data;
  13. NO_COPY_CONSTRUCTOR(WindowCapture);
  14. };
  15. /******************************************************************************/
  16. void WindowSetText (C Str &text , Ptr hwnd=App.hwnd()); // set window text title
  17. Str WindowGetText ( Ptr hwnd=App.hwnd()); // get window text title
  18. void WindowMinimize (Bool force=false, Ptr hwnd=App.hwnd()); // minimize window
  19. void WindowMaximize (Bool force=false, Ptr hwnd=App.hwnd()); // maximize window
  20. void WindowReset (Bool force=false, Ptr hwnd=App.hwnd()); // reset window from maximized/minimized to normal state (maximized/minimized -> normal)
  21. void WindowToggle (Bool force=false, Ptr hwnd=App.hwnd()); // toggle window between maximized and normal state (maximized <-> normal)
  22. void WindowActivate ( Ptr hwnd=App.hwnd()); // activate window
  23. void WindowHide ( Ptr hwnd=App.hwnd()); // hide window
  24. void WindowShow ( Ptr hwnd=App.hwnd()); // show window
  25. void WindowClose ( Ptr hwnd=App.hwnd()); // close window
  26. void WindowFlash ( Ptr hwnd=App.hwnd()); // flash window
  27. void WindowSetNormal ( Ptr hwnd=App.hwnd()); // set window taskbar to be displayed as normal (this will work only on Window 7 or newer)
  28. void WindowSetWorking ( Ptr hwnd=App.hwnd()); // set window taskbar to be displayed as working with unknown progress (this will work only on Window 7 or newer)
  29. void WindowSetProgress(Flt progress, Ptr hwnd=App.hwnd()); // set window taskbar to be displayed as working with 'progress' 0..1 value (this will work only on Window 7 or newer)
  30. void WindowSetPaused (Flt progress, Ptr hwnd=App.hwnd()); // set window taskbar to be displayed as paused with 'progress' 0..1 value (this will work only on Window 7 or newer)
  31. void WindowSetError (Flt progress, Ptr hwnd=App.hwnd()); // set window taskbar to be displayed as error with 'progress' 0..1 value (this will work only on Window 7 or newer)
  32. Byte WindowGetAlpha ( Ptr hwnd=App.hwnd()); // get window opacity (0=transparent, 255=opaque)
  33. void WindowAlpha (Byte alpha , Ptr hwnd=App.hwnd()); // set window opacity (0=transparent, 255=opaque)
  34. void WindowMove (Int dx, Int dy, Ptr hwnd=App.hwnd()); // move window by delta
  35. void WindowPos (Int x, Int y, Ptr hwnd=App.hwnd()); // set window position
  36. void WindowSize (Int w, Int h, Bool client, Ptr hwnd=App.hwnd()); // set window size
  37. VecI2 WindowSize ( Bool client, Ptr hwnd=App.hwnd()); // get window size , 'client'=if take only the client size (not including the borders)
  38. RectI WindowRect ( Bool client, Ptr hwnd=App.hwnd()); // get window rectangle, 'client'=if take only the client rectangle (not including the borders)
  39. Bool WindowMaximized ( Ptr hwnd=App.hwnd()); // if window is maximized
  40. Bool WindowMinimized ( Ptr hwnd=App.hwnd()); // if window is minimized
  41. Ptr WindowActive ( ); // get active window
  42. Ptr WindowMouse ( ); // get window under mouse cursor
  43. Ptr WindowParent ( Ptr hwnd ); // get parent of window
  44. Ptr WindowParentTop ( Ptr hwnd ); // get most top parent of window
  45. void WindowSendData (CPtr data, Int size, Ptr hwnd ); // send binary data to an application of the specified window, that application can receive the data using "App.receive_data" callback function
  46. UInt WindowProc ( Ptr hwnd ); // get process ID of window
  47. void WindowList (MemPtr<Ptr> hwnds ); // get list of all window handles in the System
  48. void WindowMsgBox(C Str &title, C Str &text, Bool error=false); // show OS message box, 'error'=if display as error or message
  49. #if EE_PRIVATE
  50. void InitWindow();
  51. void ShutWindow();
  52. #endif
  53. /******************************************************************************/