4 code/command questions

BlitzMax Forums/BlitzMax Programming/4 code/command questions

Chugs40(Posted 2008) [#1]
I am working on a new project to launch and manage all of my current and future retro/mini games.


I need some help or code for the following operations:

1) How do I add a Window icon in the left corner of the window?
2) How do I detect when the user has closed the window? I'm sure there is simple code to do this, I just can't remember!
3) How do I launch another App/Program in Bmax? Is there a command I am overlooking?
4) When the default Window is created using the Graphics() command, how do I center it on the screen? Rather than it opening in the upper left.


tonyg(Posted 2008) [#2]
1) Getting a .exe icon On Window, NO EXTERNAL FILES!

Mac: Setting the icon the "proper" way

Adding icons to BlitzMax Win32 executables

There are lots of posts on the subject as well.
2) Appterminate
3) CreateProcess or system_
Lots of posts on this as well. execfile is a good search argument too.
4) Do an advanced search on 'Window Centre'
Window To Start Centred

How to add a Windowicon + Center Window? (again)

Reposition Window

Centre a window on the Mac?

Graphics Windows are non-centred on Mac

Center a window in BMax
Change program's window start pos - is it poss?



Chugs40(Posted 2008) [#3]
Thanks for the help and the links tonyg, I've been looking these up.

I'm still wondering if any one knows how to launch another app/exe from Bmax.


tonyg(Posted 2008) [#4]
3) CreateProcess or system_
Lots of posts on this as well. execfile is a good search argument too.


Did this not come up with anything?


EOF(Posted 2008) [#5]
> I'm still wondering if any one knows how to launch another app/exe from Bmax

I posted a tutorial for this

http://www.blitzmax.com/Community/posts.php?topic=53709


Chugs40(Posted 2008) [#6]
tonyg, yeah your links are very usefull, I am still looking and trying the various code. I have the icon stuff (mingw and an icon maker) and can build icons as with all of my old Bmax apps. I need to use that code from the first link above to transfer it to the window.

Thanx Jim Brown, I am looking up the post above right now...


Chugs40(Posted 2008) [#7]
Ok, I am making some progress now.

Appterminate() works - I knew it was something easy like that! Now the app/process doesn't appear in the task menu after clicking the'X' - this is good. I may have to experiment with event trapping to terminate the app the way I want though.

Jim Browns code works great! 3 lines of code and I am launching other apps!

The window centering I am still working on. I am just creating a default window with the graphics() command (graphics 640,480,0,60) Should I create a window? I was looking at the code from the posts above, what do I with hWnd parameter? I know its a window handle, I just need to know what to do with it.

The icon issue, I know how to create app icons via mingw and linking in object files. I just have trouble getting it to appear on the window itself. So I'll keep trying code from the above posts.


Chugs40(Posted 2008) [#8]
Got the icon in the window with SetIcon function from the first post. Now moving on to centering the window...


Chugs40(Posted 2008) [#9]
Well here it is problem solved...


Thanx for all the help guys (tonyg and Jim Brown) and every one else involved in the posts and code.

Still the window moves to the center of the screen after being created with graphics(). It does this real fast but is still kinda cheesy & will work for now.
I may have to modify the module I am using (which I don't really want to do!) any suggestions on doing this?
I am using the GLmax2DDriver() with Graphics 640,480,0,60 default window @ 60hrz