Moving Blitz Window
Blitz3D Forums/Blitz3D Programming/Moving Blitz Window
| ||
Hi, Two questions: A) In windowed mode (mode 2) can I Hide the top bar, as in I want to build my own window buttons (Close, Minimise etc) B) Can I move the Window around the desktop. I want to move it to the top of the screen. I know user, or kernal commands can do this, but I am not sure which ones, or how to use them. Thanks for any help |
| ||
get yourself a copy of the win32.hlp file, a help file that explains most Win Api Commands. With this it's easy to make a decls entry for a userlib call. The sooner or later you really need the win api info stuff on your hard drive. I'd also suggest to use the forum search since this question was answered many times, no offence. Hint: you may use SetWindowPos. While there may be other commands that can do the same, this one is reliably positioning and focusing a window. in user32.decls you need: .lib "user32.dll" SetWindowPos%(hwnd%, zlevel%,x%,y%,cx%,cy%,wFlags%) Now get the win32.hlp file to read about the commands. Here's a copy: http://www.master-creating.de/purebasic.de/files/win32.zip Tho, probably not the latest, but most of those Api commands are old anyway. (on the page http://www.master-creating.de/purebasic.de/update.shtml , for in case the link doesn't work directlinked) Also see the code archives/userlibs "windows constants" entry. BTW usually you need the blitz windows handle, called "hwnd". Use hwnd%=SystemProperty$("AppHWND") in Blitz. |
| ||
Hi, right. How do I know what value to put in the flag value to set or retrieve values. For example, to get the size of the desktop res in X I am using and example taken from the code archives: api_GetSystemMetrics%(0) and Y is: api_GetSystemMetrics%(1) Looking at the User32 docs it doesn't say what int values to put in the flags to actually get these (the 0 and the 1)? So how do you find this stuff out? In the docs its just says: Any help? |
| ||
Hey guys, any help with this? |
| ||
heres the code that repositions the runtime window from winblitz3d, i never could get SetWindowPos() to work correctly.HDWP r = BeginDeferWindowPos(1); HDWP t = DeferWindowPos(r,runtimewindow,0,x,y,width,height,SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOZORDER ); EndDeferWindowPos(r); use SetWindowLong() to change the windows style kev |