How do I move the Graphics Windows position?
BlitzMax Forums/BlitzMax Programming/How do I move the Graphics Windows position?
| ||
Hey! Just wondering how I would move the graphics windows position, without having to click and drag with the mouse. I need the window to start in a random location on the screen(Don't ask), and as it is it always starts in the center ;( |
| ||
Windows Only:SuperStrict SeedRnd MilliSecs() Const SCREEN_WIDTH% = 800, SCREEN_HEIGHT% = 600 Graphics SCREEN_WIDTH, SCREEN_HEIGHT setWindowPosition(Rand(1024), Rand(800)) While Not AppTerminate() For Local i% = 0 To 100 SetColor Rand(255),Rand(255),Rand(255) Plot Rand(SCREEN_WIDTH),Rand(SCREEN_HEIGHT) Next If KeyHit(KEY_SPACE) setWindowPosition(Rand(1024), Rand(800)) Flip Wend Function setWindowPosition(x%, y%) ?Win32 SetWindowPos(GetActiveWindow(), HWND_NOTOPMOST, x , y, 0, 0, SWP_NOSIZE) ? End Function |
| ||
If you have MaxGUI you can open the window wherever you want and reposition it whenever you want. |
| ||
Thanks therevills! And yes I DO have MaxGUI :) But I probably don't need to bother with what I'm doing. Its a pretty small program. Thanks! |
| ||
You're not writing one of these annoying little programs that moves the window every time someone tries to hit the close gadget, are you? :) Ctrl,Alt,Delete will see you off, you rascal !!! |
| ||
lol |