Problem changing screen resolution.
Blitz3D Forums/Blitz3D Programming/Problem changing screen resolution.
| ||
![]() ![]() Not to do, whenever you make a change screen resolution in either full screen or windows mode, the application is behind other windows, for example if you run from your root directory, when changing screen resolution remaining after the application window. Any suggestions? |
| ||
There is a windows command to give a window the focus, i don't remmember exactly how to do it... SetWindowPos() Here : http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx |
| ||
is easier & faster :P And yes, before you ask, you CAN infact use another window handle in place of "hwnd" IF it actually IS equal to a window ID. :) Regards, ~GF |
| ||
The translator does not help me, ?, how that goes in a file userlibs ?, A more detailed example please. |
| ||
user32.decls Save the above code into a blank text file called "user32.decls" inside your "blitz3d/userlibs" folder. Then call the "api_setfocus()" function, & follow all the directions that are already in my 1st post. :) Sorry for the inconvenience, Yue! Good luck with Pawn, it's looking GOOD! Keep up the great work, Yue! :) Sincerely, ~GF |
| ||
Thank you very much, I just feel I'm like a salmon struggling upstream, I have always something to learn and improve. :) |
| ||
Oops, no run Editor Ideal... :( |
| ||
and put the file in usr libs, however not start Blitz3D editor or Ideal, which may be?![]() |
| ||
Put the user32.decls file in the blitz3d/userlibs folder, and use Blitz3D IDE. If it works in the Blitz3D IDE, then it should work in IDeal. |
| ||
It does not work, neither with nor Blitz3D Ideal if the file Userlibs off everything returns to normal. |
| ||
Ok, then open "C:\Archivos de programa\IDEal\Conf\Blitz3D.lng" & post the log so I can see what's going on. |
| ||
I'm on Windows 8-64 bits ?, will that cause the problem? |
| ||
Possibly. Try running it in Windows 7 compatibility mode. |
| ||
Now, the problem is resolved, the Draw3D2 lib makes calls to User32.dll from Userlibs directory, then within that file where the calls are made've pasted all the commands and User32 and all is well..lib "user32.dll" Draw3D2_GCP% (lpPoint*) : "GetCursorPos" Draw3D2_GWR% (hwnd%,lpRect*) : "GetWindowRect" api_SetFocus% (hwnd%) : "SetFocus" .lib " " MouseX3D( ) MouseY3D( ) MouseXOld3D( ) MouseYOld3D( ) MouseXSpeed3D( ) MouseYSpeed3D( ) MouseHit3D( ) MousePit3D( ) MouseDown3D( ) MouseOver3D( ) MouseTest3D( ) ProjectedX3D( ) ProjectedY3D( ) GetMOW3D( ) ... |
| ||
I'm glad you fixed the problem, Yue! :) See, we ALL feel like "fish upstream" most times, but we keep pushing til' we reach the top of the stream! ;) |
| ||
New problem, when I launch the application in debug mode it works correctly, the window has focus and if I try to go somewhere else is impossible, but I think if the executable does not work properly. I have the api command within the main loop. |
| ||
Only seems to work if the application is launched from the Windows desktop, if the application from a directory such launches DirPawn \ Pawn.exe not work and after the resolution change is behind the DirPawn directory ... Any idea? |
| ||
Graphics3D 800,600,32,2 Global hwnd = SystemProperty$("AppHWND") Repeat api_SetFocus(hwnd) RenderWorld Flip Forever Work Perfect on Ideal debugger true, this works fine in debug mode, but the executable does not work Is there any way to make a change screen resolution from a lib? |
| ||
Yue, set focus is to give focus to the selected window handle. SetWindowPos() is to move and / or resize the window. |
| ||
But as I do to make it above other windows and not behind the directory where the application is running? |
| ||
Ok, I get it, I am a brute in this, my greatest difficulty is not speaking English .... :( Now everything works perfectly, I just need to know what the api that returns the width and height of the desk desk to position the window in the middle of the desk. Thanks for your patience ... |
| ||
api_SetActiveWindow(hWnd) ? |
| ||
No problem, Yue. :) You're doing JUST fine bud. :) Keep on pushing along & don't even let TROLLS stop you! The rewards will be GREATLY worth it in the end. Just remember that. As for the commands you need for the Desktop resolutions, just use: Hope that helps! :) Good luck, buddy! :) Sincerely, ~GF |
| ||
Global hwnd = SystemProperty$("AppHWND") Init_ObjEscena%() ; Init Graphics3D Object G3D.Graphics3D Witht, height Init_Sistemas%() api_SetWindowPos(hwnd, -1, api_GetSystemMetrics(0)/2-G3D\Ancho/2, api_GetSystemMetrics(1)/2-G3D\Alto/2, G3D\Ancho, G3D\Alto, 1) api_SetActiveWindow% (hwnd%) Thank you very much, everything works perfect here, and the window does not stay back after the change of resolution and is active in the main desktop mode. :) |
| ||
Glad to see all is well, Yue! Don't you EVER give up again. I do NOT want to see that. Nothing in life worth having is easy. REMEMBER that! :) Don't even let the trolls bring you down, otherwise, you will never succeed! :) Sincerely, ~GF |
| ||
This is incredible, let me recognize the screen resolution of the end user's desktop, and if less than the highest display resolution supported by my application only shows the first two, to avoid the application to be much larger than the windows desktop. :). This increasingly looks better and I think if I can make a game. Desk is at 1024x768 in windowed mode, the maximum resolution is 1280 x 800 is not shown ![]() |
| ||
WOH! You're right, Yue! This IS incredible! :O GREAT job! DO NOT quit! Keep up the GREAT work! Sincerely, ~GF |
| ||
Also, if you need a beta tester / english translator, I can help with either OR both if you like! Count me in! :D This looks like it could be some fun to test! :D Way to go, Yue! :D Sincerely, ~GF |
| ||
Good job bud. |
| ||
Yue, just ignore him. He follows me around like a lost puppy dog & tries to troll me but I took away his power. :) |
| ||
I was talking to you. |
| ||
No one cares. :) |
| ||
Guy Fawkes, I use google translator to translate the English language for GUI, if not fine. |
| ||
"Accion" is not an English word -- Depending on what you need it to actually do, it should probably be either "Action" or "Task" ? |
| ||
That word I use for the user by pressing the E key, Realize an event, such as trying to open a door, kicking a box.![]() |
| ||
Add this, it's ... amust have in any games ;) Und, auf Wieder Sehen :) |