Window's Installer

Okay so im trying to make a installer for my program and everything works great other then the fact of 2 things. 1. When ever i run the installer where the checkbox "Create Shortcut" is there you can only see "Cr" but when u hit the checkbox and then hit the install button the whole "create shortcut" shows up?
2. When i run the program i have a message box that comes up saying Installation Complete. I want it to come up once the progress bar finish's but right now its comming up right when you hit install.

Does anyone know how to fix this? Here is my code for it:

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
static HWND hwndPrgBar;
  static int i = 1;
  static char *Title = TEXT("         Database FX Installer \n\
Developed By: MacKenzie Whipp");
  INITCOMMONCONTROLSEX InitCtrlEx;

  InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
  InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS;
  InitCommonControlsEx(&InitCtrlEx);
  enum{ID_CREATE_SHORTCUT, ID_TITLE, ID_PROGRESS, ID_INSTALL };
  switch(msg)  
  {
      case WM_CREATE:
           HWND hInstallButton;
           int idInstallButton;
         hInstallButton = CreateWindow(TEXT("button"), TEXT("Create Shortcut"),
                  WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
                  20, 125, 185, 35,        
                  hwnd, (HMENU) ID_CREATE_SHORTCUT, ((LPCREATESTRUCT)lParam)->hInstance, NULL);

           idInstallButton = GetDlgCtrlID(hInstallButton);
 	       CheckDlgButton(hwnd, ID_CREATE_SHORTCUT, BST_UNCHECKED);
	    
           CreateWindow(TEXT("STATIC"), Title, WS_CHILD | WS_VISIBLE | SS_LEFT, 50, 20, 300, 230, hwnd, NULL, NULL, NULL);  

 
		    
		    
          hwndPrgBar = CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE | PBS_SMOOTH, 50, 100, 190, 25, hwnd, NULL, g_hinst, NULL);   

          CreateWindow(TEXT("button"), TEXT("Install"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 100, 70, 80, 25, hwnd, (HMENU) ID_INSTALL, g_hinst, NULL);  

        SendMessage(hwndPrgBar, PBM_SETRANGE, 0, MAKELPARAM(0, 150));
        SendMessage(hwndPrgBar, PBM_SETSTEP, 1, 0 );
          break;


      case WM_TIMER:
          SendMessage( hwndPrgBar, PBM_STEPIT, 0, 0 );
          i++;
          if ( i == 150 ) 
              KillTimer(hwnd, ID_TIMER);
          break;
              
      case WM_COMMAND:
		    switch (LOWORD(wParam))
            {
                case ID_CREATE_SHORTCUT:
                     {
                                if(IsDlgButtonChecked(hwnd, ID_CREATE_SHORTCUT) == BST_CHECKED)
                                {
                                                            //CREATE SHORTCUT IF CHECKED
                                                            
                                }
                                else
                                {
                                    //dont
                                }
                                break;
                 }
                    break;
                case ID_INSTALL:
                     {

                         i = 1;
                        SendMessage( hwndPrgBar, PBM_SETPOS, 0, 0 );
                        SetTimer(hwnd, ID_TIMER, 5, NULL);
                        mkdir("C:\\Program Files (x86)\\Database FX");
                        CopyFile("F:\\Computer Programming\\Database\\Database_FX.exe", "C:\\Program Files (x86)\\Database FX\\Database_FX.exe", TRUE);
                        MessageBox(0,"Installation Successful", "Installation Complete", MB_OK );
                        PostQuitMessage(0);
                        
                     }
                        
                     
            }
          break;

      case WM_DESTROY:
          KillTimer(hwnd, ID_TIMER);
          PostQuitMessage(0);
          break; 
      
  }
Topic archived. No new replies allowed.