Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-15-2008, 11:08 AM
Qelchor Qelchor is offline
Newbie
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
Qelchor is on a distinguished road
Default Making a launcher and languale selector for Monkey Island

Hi people from CodeCall!

I started program a few days and I'm trying make a launcher for ScummVM and a language selector for Monkey Island 3.

With the launcher I didn't have too much problems. The codes is this:

PHP Code:
#include <stdio.h>
#include <windows.h>

int main()
{
system("SCUMMVM\\scummvm.exe -c SCUMMVM\\scummvm.ini");
return 
0;

I made this because ScummVM doesn't read the scummvm.ini in portable mode without the "-c" attribute.
This is just C. But I wish this launcher has a icon, but this is for DOS. ¿It's possible made a hide program to execute ScuumVM and have a icon?



The other thing is about a language selector. The file LANGUAGE.TAB have the subtitles and VOXDISK1.BUN and VOXDISK2.BUN have the voices. Because I have the italian and spanish subtitles and voices I wanna make a program to select the subtitle and voice renaming the files like this:

Subtitles in spanish:
LANGUAGE.TAB --> LANGUAGE.TAB_EN
LANGUAGE.TAB_SP --> LANGUAGE.TAB

Voices in italian:
VOXDISK1.BUN --> VOXDISK1.BUN_EN
VOXDISK1.BUN_IT --> VOXDISK1.BUN
VOXDISK1.BUN --> VOXDISK2.BUN_EN
VOXDISK2.BUN_IT --> VOXDISK2.BUN


I don't pretend you made the programm, I just need some instructions to made that.
I'm using CodeBlocks like IDE and MinGW like compilator.

Thanks.

Last edited by Qelchor; 07-15-2008 at 11:20 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-18-2008, 11:39 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Making a launcher and languale selector for Monkey Island

Is there a way to force ScummVM to load the files, or would you have to edit the binary code of the program itself? Are the options contained in the .INI file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-19-2008, 10:35 AM
Qelchor Qelchor is offline
Newbie
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
Qelchor is on a distinguished road
Default Re: Making a launcher and languale selector for Monkey Island

Thanks dargueta for the reply.

I want ScummVM load the settings from scummvm.ini in the ScummVM folder, and I'm using the command scummvm.exe -c scummvm.ini. This is to make ScummVM portable.

Finally I discover a code to hide the console windows of SucmmVM.


launcher.c
Code:
#define _WIN32_WINNT 0x0500
#include <windows.h>

int main()
{
HWND hWnd = GetConsoleWindow();
ShowWindow( hWnd, SW_HIDE );
system("SCUMMVM\\scummvm.exe -c SCUMMVM\\scummvm.ini");

return 0;
}


launcher.rc
Code:
#include "resource.h"

IDI_ICON ICON "launcher.ico"


resource.h
Code:
#define IDI_ICON 101

launcher.ico



I compiled it with MinGW from CodeBlocks and the program works fine, but the .exe stills without appear in the icon.
What I'm doing wrong?

Last edited by Qelchor; 07-19-2008 at 02:43 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-20-2008, 02:18 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Making a launcher and languale selector for Monkey Island

If there's no window, then there won't be an icon. Unless you're talking about the thumbnail image, in which case the only reason why there wouldn't be an icon is because it's of the wrong size. 32x32 is the standard size for thumbnail images, 16x16 for taskbar and titlebar images. Most applications have both, and the system chooses the correct one to display.

Could you post the contents of scummvm.ini so I can show you how to force the program to load the correct files?

Last edited by dargueta; 07-20-2008 at 02:28 PM. Reason: Wrong, wrong, wrong.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-20-2008, 02:35 PM
Qelchor Qelchor is offline
Newbie
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
Qelchor is on a distinguished road
Default Re: Making a launcher and languale selector for Monkey Island

Yes, I know this about icons.

I think the problem is with CodeBlocks or the MinGW. I compilated a program sample from the source and don't build the program with the icon.

What's so complicaded?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-20-2008, 03:24 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Making a launcher and languale selector for Monkey Island

I've never used either, so I wouldn't know. I think Xav might.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-20-2008, 03:44 PM
Qelchor Qelchor is offline
Newbie
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
Qelchor is on a distinguished road
Default Re: Making a launcher and languale selector for Monkey Island

Ok, I solved it. I create a CodeBlock new project and copy the contest from the old files.

Thanks dargueta
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-20-2008, 06:32 PM
MeTh0Dz|Reb0rn's Avatar   
MeTh0Dz|Reb0rn MeTh0Dz|Reb0rn is online now
My Posts Are Moderated
 
Join Date: Jul 2008
Posts: 85
Rep Power: 0
MeTh0Dz|Reb0rn is an unknown quantity at this point
Default Re: Making a launcher and languale selector for Monkey Island

Okay two things...

Best way to hide the window is just to compile it as a Win32 application.

Secondly using system() is very ugly and shouldn't really be done.
Just use ShellExecute().
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-20-2008, 09:53 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Making a launcher and languale selector for Monkey Island

To make a Win32 application, you can copy and paste this code, then modify it to suit your needs. You may need to change your compiler settings.

Code:
#include <windows.h>
//other includes go here

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, \
    LPSTR lpCmdLine, int nCmdShow)
{
    //put your main() code here. A window isn't created
    //unless you explicitly code one.

    return 0;  //or whatever other value you want
}
Win32 Programming Tutorial
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-20-2008, 10:18 PM
MeTh0Dz|Reb0rn's Avatar   
MeTh0Dz|Reb0rn MeTh0Dz|Reb0rn is online now
My Posts Are Moderated
 
Join Date: Jul 2008
Posts: 85
Rep Power: 0
MeTh0Dz|Reb0rn is an unknown quantity at this point
Default Re: Making a launcher and languale selector for Monkey Island

The ShowWindow() method will flash a command prompt before it hides the program.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply

Tags
island, launcher, selector



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 11:44 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads