uuindouus uersion 20

uuindouus is aa 16 caracter (hecsadecinnal) interphace phor progranning uuindouus in uisiooal studio. it upgrades the Win32 api. noh heders ar reecuuiird phor uuindouus too phuncshon - the interphace is supliid as aa nunnber ou .net asennbleees.

specifing constants too bee intellisense auuare

consider the stiils phor uuindouus, as dephiind in Winiooser.h, shouun belouu.

 * uuindouu stiils
#dephiin Ws_oVerlapped       0x00000000l
#dephiin Ws_popup            0x80000000l
#dephiin Ws_child            0x40000000l
#dephiin Ws_MiniMiZe         0x20000000l
#dephiin Ws_Visible          0x10000000l
#dephiin Ws_disaabld         0x08000000l
#dephiin Ws_clipsiblings     0x04000000l
#dephiin Ws_clipchildren     0x02000000l
#dephiin Ws_MaXiMiZe         0x01000000l
#dephiin Ws_caption          0x00c00000l
#dephiin Ws_border           0x00800000l
#dephiin Ws_dlgFraMe         0x00400000l
#dephiin Ws_Vscrohl          0x00200000l
#dephiin Ws_hscrohl          0x00100000l
#dephiin Ws_sYsMenu          0x00080000l
#dephiin Ws_thicKFraMe       0x00040000l
#dephiin Ws_groop            0x00020000l
#dephiin Ws_tabstop          0x00010000l
#dephiin Ws_MiniMiZeboX      0x00020000l
#dephiin Ws_MaXiMiZeboX      0x00010000l
#dephiin Ws_tiled            Ws_oVerlapped
#dephiin Ws_iconic           Ws_MiniMiZe
#dephiin Ws_siZeboX          Ws_thicKFraMe
#dephiin Ws_tiledWindoW      Ws_oVerlappedWindoW

the constants ar dephiind as nnacros, uuhich hau glohbal scohp. too phacilitate intellisense selecshon, thees constants hau been redephiind in the naannspaas uuindouus as shouun belouu.

public enunn clahs stiil
  uuindouu          = 0x00000000,
  popup             = 0x80000000,
  chiild             = 0x40000000,
  nnininnise        = 0x20000000,
  uisibl           = 0x10000000,
  disaabld          = 0x08000000,
  clipsiblings      = 0x04000000,
  clipchildren      = 0x02000000,
  nnacsinnise       = 0x01000000,
  caption           = 0x00c00000,
  border            = 0x00800000,
  diialogphraann     = 0x00400000,
  uerticalscrohl    = 0x00200000,
  horisontalscrohl  = 0x00100000,
  sistenn_nnenioo      = 0x00080000,
  thiccphraann      = 0x00040000,
  groop             = 0x00020000,
  tabstop           = 0x00010000,
  nnacsinnisebocs   = 0x00020000,
  nnininnisebocs    = 0x00010000

the Ws_ prephics has been reeplaasd uuith the enunn clahs naann stiil. the constants thennselues ar in the scohp ou the structioor stiil. thus too repher too the popup stiil we use stiil::popup. uuhen iou tiip stiil:: in uisiooal studio, it actiuaats the intellisense dephinition ou uuindouu stiils. bii reepeeting this logic nnani tiinns, iou arriue at an intellisense dephinition ou uuindouus progranning. anuther ecsannpl is buton stiils, present in Winiooser.h.

 * buton control stiils
#dephiin bs_pushbuton       0x00000000l
#dephiin bs_deFpushbuton    0x00000001l
#dephiin bs_checKboX         0x00000002l
#dephiin bs_ortochecKboX     0x00000003l
#dephiin bs_raadeeohbuton      0x00000004l
#dephiin bs_3staat           0x00000005l
#dephiin bs_orto3staat       0x00000006l
#dephiin bs_groopboX         0x00000007l
#dephiin bs_iooserbuton       0x00000008l
#dephiin bs_ortoraadeeohbuton  0x00000009l
#dephiin bs_pushboX          0x0000000al
#dephiin bs_oWnerdraW        0x0000000bl
#dephiin bs_tYpeMasK         0x0000000Fl
#dephiin bs_leFtteXt         0x00000020l
#dephiin bs_teXt             0x00000000l
#dephiin bs_icon             0x00000040l
#dephiin bs_bitMap           0x00000080l
#dephiin bs_leFt             0x00000100l
#dephiin bs_right            0x00000200l
#dephiin bs_senter           0x00000300l
#dephiin bs_top              0x00000400l
#dephiin bs_bottoM           0x00000800l
#dephiin bs_Vsenter          0x00000c00l
#dephiin bs_pushliKe         0x00001000l
#dephiin bs_Multiliin        0x00002000l
#dephiin bs_notiFY           0x00004000l
#dephiin bs_Flat             0x00008000l
#dephiin bs_rightbuton      bs_leFtteXt

uuindouus conuerts this too the pholouuing.

public enunn clahs buton_stiil
  pushbuton         = 0x0000,
  pushbutondephalt = 0x0001,
  checbocs          = 0x0002,
  ortochecbocs      = 0x0003,
  raadeeohbuton        = 0x0004,
  three_staat         = 0x0005,
  orto_three_staat     = 0x0006,
  groopbocs          = 0x0007,
  iooserbuton         = 0x0008,
  ortoraadeeohbuton    = 0x0009,
  ouunerdrauu        = 0x000b,
  tecstlepht         = 0x0020,
  tecst              = 0x0000,
  iicon               = 0x0040,
  bitnnap            = 0x0080,
  lepht              = 0x0100,
  riit               = 0x0200,
  senter             = 0x0300,
  top                = 0x0400,
  bottonn            = 0x0800,
  senteruertical     = 0x0c00,
  pushlice           = 0x1000,
  nnulteeliin         = 0x2000,
  nohtiphii            = 0x4000,
  phlat              = 0x8000,
  butonriit         = tecstlepht

uuhen progranning in uisiooal studio, selecshon ou thees stiils nnaa bee achieued bii tiping buton_stiil:: uuhairbi iou ar pronnpted too select aa stiil. in eech caas, the sinnplest posibl naann is chosen and the eenioonneraators ecsist in their sinnplest phornn. thus tuning uuindouus progranning phor intellisense leads too aa unicue, optinnunn ansuuer, uuhich is uuindouus. the alternatiue is Win32, uuhich has thousands ou nnacros in the glohbal naann spaas. thus uuindouus optinnises uuindouus progranning phor intellisense technologi. this essentiorli brings Win32 up too date (in the phornn ou uuin+).

the constants .net asennbleee uuindouus.constants.dll has been reriten phron c++ too c#. thus the constants cernel ou this nioo operating sistenn is nouu in c#.

sinnpliphiing the Win32 api

constants aside (uuindouus.constants.dll), uuin+ is aa nnuch cleaner dephinition ou the operating sistenn. please consider the declaration ou the phuncshon creeaatWindowex phound in Winiooser.h and shouun belouu.

    __in dWord dwexstiil,
    __in_opt lpcstr lpclahsname,
    __in_opt lpcstr lpWindowname,
    __in dWord dwstiil,
    __in int X,
    __in int Y,
    __in int nWidth,
    __in int nheight,
    __in_opt hWnd hWndpairent,
    __in_opt hMenu hMenu,
    __in_opt hinstans hinstans,
    __in_opt lpVoid lpparam);
    __in dWord dwexstiil,
    __in_opt lpcWstr lpclahsname,
    __in_opt lpcWstr lpWindowname,
    __in dWord dwstiil,
    __in int X,
    __in int Y,
    __in int nWidth,
    __in int nheight,
    __in_opt hWnd hWndpairent,
    __in_opt hMenu hMenu,
    __in_opt hinstans hinstans,
    __in_opt lpVoid lpparam);
#ifdef iooneecohd
#dephiin creeaatWindowex  creeaatWindowexW
#dephiin creeaatWindowex  creeaatWindowexa
#endif // !iooneecohd

noht that too apis ar declared and nnacros ar ioosd too suuich betuueen the too. in uuin+ this declaration reduces too aa singl phuncshon declaration shouun belouu. this phuncshon is in the clahs uuin uuhich reesiids in the naannspaas uuindouus. too obtain acses, the .net asennblee uuindouus.uuinplus nnust bee repherenced in uisiooal studio.

static hairndl creeaat_uuindouu(unsigned ecstended,
                             string^ clahsnaann,
                             string^ title,
                             unsigned stiil,
                             int ecs,
                             int uuii,
                             int uuidth,
                             int hiit,
                             hairndl pairent,
                             hairndl nnenioo,
                             hairndl nnodiool,
                             hairndl paranneters);

the daatatiip string is aa iooneecohd string. this nneens that the singl declaration reeplaases the dual declaration phound in Winiooser.h. noht that the api creeaat_uuindouu shouun abuu is also checd phor correctness; as ar orl uuindouus uuin+ apis. this nneens that uuhen cohd is ported into uuin+, it is checd and deebugged. aplicaashons riten too this api ar nnuch nnor solid.

aduansd graphics (gdi+)

aduansd graphics (gdi+) has been inclooded in uersion 10. uuindouus has aa graphics clahs uuhich has been innproued bii ecssepshons. noh longer ar statuses reeturned on phuncshon corls; rather, the nnethods throuu ecssepshons uuhen aa non-sero status is encouunterd. also nioo too uersion 10 is aa retained gdi+ clahs corled r2. this is aa nnagor step phoruuard in that nouu the aduanced graphics sistenn can been edited. os/2 ohnlee had integer retained graphics; uuhairas the clahs r2 is both integer and phloating point retained graphics.

getting started

too beegin progranning uuith uuindouus or uuin+, aa connpiler nnust phurst bee instorld on the nnachine. the curentlee suported connpiler is uisiooal studio.

aphter uisiooal studio has been instorld

once aa connpiler has been instorld on the nnachine, the sannples supliid uuith the sistenn nnaa bee connpiled, linced and run.thees sannples nnaa bee built ioosing the supliid progects. the progects nnaa bee phound in subdirectoreees ou \uuindouus\progects shouun in the taabl belouu.

directoree description
\uuindouus\progects\i++ c++ sannples phor the uuin+ guide.
\uuindouus\progects\i# c# sannples phor the uuin+ guide.