   about the windows event
  HI all!!I am a chinese student.I come here for my question what i can not solve in chinese forums.I write a program.It is a WM_POPUP style windows program.Now,I want to add some function on it,like move the window and minimize it.I would add some button to do it.But now i have no idea.MSDN have nothing about it,maybe my english is not very good. On the whole,how can i add the button to control the window events???THANKS!!!   
Quote:Original post by chinaSTUHI all!!I am a chinese student.I come here for my question what i can not solve in chinese forums.I write a program.It is a WM_POPUP style windows program.Now,I want to add some function on it,like move the window and minimize it.I would add some button to do it.But now i have no idea.MSDN have nothing about it,maybe my english is not very good. On the whole,how can i add the button to control the window events???THANKS!!!You'll need to use WS_OVERLAPPEDWINDOW to have a resizable border and title bar with buttons. Make sure you use AdjustWindowRect() to get the correct size to give to CreateWindow() though.   ;  oh!Thank you ,Steve.But maybe I can't describe my problem very well.I mean,I just want to replace the blue bar(the typical bar which WM_OVERLAPPEDWINDOW define) with my bar.Easily to speak,I want my bar at the top of my program is black,and beautiful.Can i do this???   ;Quote:Original post by chinaSTUoh!Thank you ,Steve.But maybe I can't describe my problem very well.I mean,I just want to replace the blue bar(the typical bar which WM_OVERLAPPEDWINDOW define) with my bar.Easily to speak,I want my bar at the top of my program is black,and beautiful.Can i do this???There's two way to do this:1. Render the buttons, sizing edges, etc yourself in D3D (Probably as sprites), with a WS_POPUP style window2. Use WM_NCPAINT and WS_OVERLAPPEDWINDOW and use GDI to draw your own window frame. You'll also need to override some of the WM_NC* messages to correctly detect the new positions and sizes of your buttons and so on.Personally, I'd go for option #1, it should be less painful overall - particularly if you have a UI already set up.   ;  YES!!!I just do this like your option#1.I render the minimized button and the move button;and i have no idea with the click events.Which function can help me to alter the window.x_pos and window.y_pos?May be create a new window and show it after i move the cursor? Thanks.   ;Quote:Original post by chinaSTUYES!!!I just do this like your option#1.I render the minimized button and the move button;and i have no idea with the click events.Which function can help me to alter the window.x_pos and window.y_pos?May be create a new window and show it after i move the cursor? Thanks.SetWindowPos will let you change the size and position of the window.   