I have a simple window that opens, stays open, and closes when you click the X... nothing more.
How would I put a picture into it, and how would I get the location of the mouse pointer in it?
I have a simple window that opens, stays open, and closes when you click the X... nothing more.
How would I put a picture into it, and how would I get the location of the mouse pointer in it?
Ok, to put a picture in your backround you need to have a bitmap(obviously) and to load that from a file the code will look like:
Now for mouse position, you simply trap the WM_MOUSEMOVE or button messages and then:Code:HBITMAP backround; HBRUSH hBrush; background = (HBITMAP)LoadImage(hinstance,"background.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); hBrush = CreatePatternBrush(backround); DeleteObject(background); //then in your class def for hbrbackground wndclass.hbrbackground = hBrush; //this will load your bitmap to the background.
Code:case WM_MOUSEMOVE: mouse.x = LOWORD(lParam); mouse.y = HIWORD(lParam); //other stuff
I was looking for something more similar to a picturebox in Visual basic.
hmmm........ C++ board??????? What language are you using for your windows Apps? MFC, WIN32 API, Visual Basic?
By the way you'll get more input if you post in the Windows forum.