File: gui.c

package info (click to toggle)
bitcollider 0.3.1-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,116 kB
  • ctags: 573
  • sloc: sh: 5,490; ansic: 4,805; cpp: 245; makefile: 109
file content (58 lines) | stat: -rw-r--r-- 1,231 bytes parent folder | download
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
/* (PD) 2001 The Bitzi Corporation
 * Please see file COPYING or http://bitzi.com/publicdomain 
 * for more info.
 *
 * $Id: gui.c,v 1.4 2001/04/06 01:48:13 mayhemchaos Exp $
 */

#include <windows.h>
#include <stdlib.h>
#include "bitcollider.h"
#include "list.h"
#include "dirsearch.h"
#include "gui_win32.h"
#include "resource.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	MSG    msg;
    HWND   hWnd;
    DWORD  dwThreadId;
    List  *list;
    int    argIndex = 1;

    list = create_list();
    for(; argIndex < __argc; argIndex++)
    {
       add_to_list(list, __argv[argIndex]);
    }

	// Perform application initialization:
	hWnd = init_gui();
    if (hWnd == NULL) 
	{
		return FALSE;
	}

    if (CreateThread(NULL, 0, BitcolliderThread, list, 0, &dwThreadId) == NULL)
       MessageBox(NULL, "Cannot create thread.", "Bitcollider", MB_OK);

	// Main message loop:
	while (GetMessage(&msg, NULL, 0, 0)) 
	{
        if (!IsDialogMessage(hWnd, &msg))
        {
            TranslateMessage(&msg);
  		    DispatchMessage(&msg);
        }
	}
    delete_list(list);

	return msg.wParam;
}