ntdef.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __NTDEF
  2. #define __NTDEF
  3. #include <windows.h>
  4. #define INVALID_HANDLE ((HANDLE) -2)
  5. #define NONMAPPED_HANDLE ((HANDLE) -3)
  6. #define VALID_WINDOW(x) (x && (((NT_window *)x)->w != INVALID_HANDLE))
  7. #define xtrace
  8. #define cjh_printf
  9. #define CNUMTORGB(x) x
  10. /* #define printf(x) *//* x */
  11. /* #define SetSystemPaletteUse(x) *//* x */
  12. /* Windows NT Special event aliases */
  13. #define USR_MapNotify 0x0401
  14. #define USR_EnterNotify 0x0402
  15. #define USR_LeaveNotify 0x0403
  16. #define USR_Expose 0x0404
  17. #define USR_ResizeRequest 0x0405
  18. #define USR_WakeUp 0x0406
  19. #define USR_ConvertSelection 0x0407
  20. struct NT_child
  21. {
  22. struct NT_window *w;
  23. struct NT_child *next;
  24. } NT_child;
  25. typedef struct NT_window
  26. {
  27. HWND w;
  28. HBRUSH bg;
  29. int parentRelative;
  30. struct NT_window *parent; /* parent of this window */
  31. struct NT_window *next; /* next window in list */
  32. struct NT_child *child; /* points to list of children */
  33. int x, y; /* Position */
  34. unsigned int wdth, hght; /* Dimensions */
  35. char *title_text;
  36. struct NT_prop_list *props; /* linked list of properties.*/
  37. HDC hDC;
  38. HBITMAP hBitmap;
  39. int min;
  40. int minx, miny; /* minimum window size */
  41. int top_flag;
  42. long mask; /* selectInputMask */
  43. } NT_window;
  44. /* Routine declarations */
  45. struct NT_window *NT_find_window_from_id();
  46. int NT_delete_window();
  47. struct NT_window *NT_new_window();
  48. int NT_add_child(NT_window *parent,NT_window *child);
  49. struct NT_window *NT_find_child(NT_window *w,unsigned long mask,
  50. unsigned long val);
  51. int NT_del_child(NT_window *parent,NT_window *child);
  52. void freeMemory(void *p);
  53. void *allocateMemory(int s);
  54. void initQ();
  55. void catchNextDestroyClipboard();
  56. void NT_SetAtom(ATOM class);
  57. HWND NT_create_window(char *title,DWORD style,int x,int y,int w, int h,HWND parent);
  58. LONG NT_handleMsg(HWND hWnd,UINT message,UINT wParam,LONG lParam);
  59. HBITMAP NT_getWallpaper();
  60. void NT_moveWindow(NT_window *ntw, BOOL repaint);
  61. #endif