Could you write this program for me?

Pages: 12
First of all, this is not my homework, but for the company I work for. This is what happened:

-I created a Java application which was basically a "application launcher". The application contained a simple window which had buttons. These buttons launched other applications.
-I compiled the Java application to native exe, and then burned the application to a CDROM, along with the additional exes that the application was supposed to launch.
-The final product, is that the final compiled exe took about 60 seconds to start up. This is WAY TOO LONG for a product of this sort, which should open up immediately or almost immediately.
-Therefore, my boss asked me to speed up this program in anyway I could. I concluded the best way was to write it in C++ rather than JIT compiled Java (I can't write it in pure Java because the program is supposed to have NO INSTALLATION REQUIREMENTS).


-I read the C++ tutorial on this site in the last days.
-I do not yet understand the graphical aspect of C++ (a form with buttons)
-I have Visual C++ 2010.
-I think I must experiment and learn a lot more before I am able to program windows forms, since I only know the stuff contained in the tutorial on this site.


Anyway... because I consider this program to be quite simple (a simple form with buttons which call other exes), I was wondering if anyone could write it for me.

It would serve as a basic tutorial for me, but also solve this issue where my application will be faster.

Here is a screenshot of the program that I must replicate in C++:

http://imageshack.us/photo/my-images/707/l6iu.png/?sa=0


Also, the application should be able to run with an autorun on CDROM and should have no requirements except having Windows, in other words a standalone exe. Also, each button basically just launches another exe file.


EDIT: If you can't write it for me, could you tell me how I would go about writing it? I literally have no clue about windows forms in C++
Last edited on
I don't know how to write this as a windows application but I know you could write it easily using the Sdl library in c++ creating custom images and mouse parameters
I could write it for you, would you be willing to pay?
Why don't you try using Visual Basic?
Perhaps that'll do the trick?
I could try Visual Basic, but I already read the whole C++ tutorial hehe :). I am assuming that coding up such a program is not as simple as it looks on paper in C++ at least?
im already almost halfway done making your program
You have to turn on the option to accept private messages.
> This user does not accept Private Messages

First, you should have posted this under Windows programming, Lounge or Jobs would have been even better.

Looks like you just want a menu with up to 16 items.

Since you did not mention it, I assume there is no pay involved.

Let me ask, what company do you work for and how many CD/DVD's are you planning to ship ? Are you selling the CD's or what is the project ?
ill just use the image you provided as what you're looking for
Last edited on
closed account (18hRX9L8)
@huike
Look at the picture he posted.
^ (16 buttons)
Okay, download and configure SDL library and this code should start you off, all you have to do is mess with the images and setup mouse coordinates to load the different images (for the buttons highlighting) and the depending on where your mouse coordinate is when you click it loads the different exes using "System(example.exe);"
I made example images for you as well, ill upload them to some site

i pulled a bunch of this code from my other sdl projects btw


all this code does it create a screen, hide the console window, rename the screen to the title you had, reposition it, load the image you had and wait for you to press escape and it will close

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

#include "SDL_syswm.h"
#include "SDL.h"

#include <Windows.h>
#include <fstream>

#include "SDL_TTF.h" 
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <locale>
#include <sstream>
#define SCREEN_WIDTH  778
#define SCREEN_HEIGHT 446

#define _WIN32_WINNT 0x0500
using namespace std;

/* source and destination rectangles */

	
int main ( int argc, char *argv[] )
{
	
	
	
	SDL_Event event;


	  
	  
	  
	  TTF_Init();
	HWND hWnd = GetConsoleWindow();
	ShowWindow( hWnd, SW_HIDE );
  SDL_Surface *screen, *temp, *image1;

  int colorkey;

  // IMAGE INITIALIZATIONS ---------------------------------------------------------------------------------------------
 //image1 rect
  
  SDL_Rect image1Src, image1Dest;
  image1Dest.x = 0;
	  image1Dest.y = 0;
	  image1Src.x = 0;
  image1Src.y = 0;
  image1Src.w = 778;
  image1Src.h = 446;
  
 

 
  // END IMAGE INITIALIZATIONS-------------------------------------------------------------------------------------------


  /* initialize SDL */
  SDL_Init(SDL_INIT_VIDEO);

  /* set the title bar */
   const char* WINDOW_TITLE = "TITLE GOES HERE";
  SDL_WM_SetCaption(WINDOW_TITLE, 0);

  /* create window */
  // value of screenmode for full screen is 0x80000000, value for windowed is 0
  
screenmode:
  
 
  screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);


  // CODE FOR REPOSITIONING WINDOW

SDL_SysWMinfo windowInfo;
SDL_VERSION(&windowInfo.version);

if(SDL_GetWMInfo(&windowInfo))
{
    // we retrieve the Windows specific 'handle' to the SDL window.
    HWND handle = windowInfo.window;
    
    // we can set the position of the window, using the Win32 function, 'SetWindowPos'.
     BOOL result = SetWindowPos(handle, NULL, 50, 0, 0, 0, 
                    SWP_NOREPOSITION|SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
}
  // END OF WINDOW REPOSITIONING

  //
  
  // IMAGE LOADING ------------------------------------------------------------------------------
  
  /* load image1*/
  temp  = SDL_LoadBMP("image1.bmp");
  image1 = SDL_DisplayFormat(temp);
  SDL_FreeSurface(temp);

  int running = 1;
while (running==1)
{
	
		SDL_Event event;
		 if (SDL_PollEvent(&event))
		 {
		 
		switch (event.type) { 
		
		case SDL_KEYDOWN:
      switch (event.key.keysym.sym) {
       
	case SDLK_ESCAPE:
  running = 0;
          break;
	  }
		break;
		}
		 }
			SDL_BlitSurface(image1, &image1Src, screen, &image1Dest);
	  SDL_Flip(screen);



      }
		return 0;




}



download the images here:

http://www.speedyshare.com/7ME3t/folder.7z



im too lazy to finish =[
Last edited on
Basically, we have a package of 16 programs that do various things. Each of them has a setup and installation that come bundled in something like setup.exe. So we have like setup1.exe, setup2.exe... etc.

So the program is basically just an installation menu, asking which program you want to install. When I click on a button, it executes the setup for the corresponding program.


So it is basically just an installer for 16 different programs, but let's you choose which one you want to install. I may as well have bundled the 16 exes in a CDROM, but it looks nicer to have a menu.

Huike - your PM's are indeed turned off ;)
Oh I just saw your post, hold on.

Edit: do turn your PMS on though!
Last edited on
Found this, that might help you understand the basics.

http://www.youtube.com/watch?v=nqC5GKr6yDY

can email me lukerossie@gmail.com

turned my pms on also
Last edited on
Still can not private message you. Msg me if your still needing a finished product.

Screenshot : http://sharesend.com/0qbmzbis
Last edited on
Sam, could you post the code for that? I'd be very interested to see it
I ran into a bug, when I put a picture on the form, I get a error when I compile, I was going to try and figure that out today.
SamuelAdams: the youtube link you gave me uses "Windows Forms Application". Does this mean that my target computer will require the .NET framework to run the app?

It does seem to be a pretty useful tutorial though :)
Last edited on
I think .net is required to compile the program but everything should be in the .exe to run it on any windows machine.

Here are the steps to create your own
open Visual C++ 2010 express
choose new project
choose windows form application
type in a name, click ok
Click View | Other Windows | Toolbox
Click View | Other Windows | Properties

Click Form1.h so that Form1 is Highlighted
Under Properties find size and change it from 300, 300 to 500, 400, or desired size.
In the Toolbox, drag PictureBox to Form1 - Twice

Click one picturebox at a time and change the Location and Size
Location for the first one may be 20, 30
You might try 100, 50 for the Size
adjust the above as desired

I had trouble if I did not add the image at this time, so add the logos now.
CLick the first picturebox in Form1
Find and click on Image under properties
click the little box on right to select the image.
Find SizeMode and change to CenterImage.

Once the images look like you want,
Find Label in the Toolbox section and drag to top center.
Change Text in properties to display any message you want.

Next Drag Button from the toolbox to Form1 for as many programs as you want. I like the 4x4 layout but you can lay them out anyway you like.

To make a button run a program, double click the button and for my test I simply typed
system("Runme.bat");

There are many ways to run a program, you just need to find the one that works for you.

at the top of form1.h under
#pragma once

add the line
#include <stdlib.h>


Save it
Press F5 to Debug


That should give you the basic design/setup.

Once you get a prototype, you might want to test it on several machines running various versions of windows.

PS. I tested this, and it runs fast, almost no startup time, on a CD, it could take a second at most I would think.
Last edited on
I think .net is required to compile the program but everything should be in the .exe to run it on any windows machine.


I may be wrong, but I thought that programs using .net require .net to be installed on computer.
Pages: 12