コード例 #1
0
ファイル: WinPaint.cpp プロジェクト: SamsonWang/Study
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	AllocConsole();
	g_hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
 	g_hInstance = hInstance; //保存当前程序实例句柄
	Regsiter("Main",WndProc);
	HWND hWnd = CreateMain("Main","Window");
	Display(hWnd);
	Message();
	return 0;
}
コード例 #2
0
ファイル: tmix.c プロジェクト: AEonZR/GtkRadiant
void Cmd_TextureMix()
{
    miptex32_t		*qtex32;
    char			filename[1024];
    int				size;

    InitVars();

    GetScriptToken (false);

    strcpy(root, token);
    RemoveExt(root);
    RemoveLeading(root);

    strcpy(filename, ExpandPathAndArchive(token));
    if (SetVars(filename))
    {
        // Create combined texture
        percent = ((TotalArea() * 100) / (out.w * out.h));
        printf("Total area consumed : %d%%\n", percent);
        printf("Texture resolution  : %dx%d pixels.\n", xcharsize, ycharsize);
        CreateMain();

        // Save image as m32
        sprintf (filename, "%spics/misc/%s.m32", gamedir, out.name);
        qtex32 = CreateMip32((unsigned *)outpixels, out.w, out.h, &size, false);

        qtex32->contents = 0;
        qtex32->value = 0;
        qtex32->scale_x = 1.0;
        qtex32->scale_y = 1.0;
        sprintf (qtex32->name, "misc/%s", out.name);

        printf ("\n\nwriting %s\n", filename);
        SaveFile (filename, (byte *)qtex32, size);
        free (qtex32);

        // Save out script file
        sprintf (filename, "%spics/misc/%s.fnt", gamedir, outscript);
        printf("Writing %s as script file\n", filename);
        if (!SaveScript(filename))
        {
            printf("Unable to save output script.\n");
        }
    }
    printf("Everythings groovy.\n");
    Cleanup();
}
コード例 #3
0
ファイル: WinMenu.cpp プロジェクト: dekai-wang/TestCode
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    g_hInstance = hInstance;
    if( !Register( "Wnd", WndProc ) )
    {
        MessageBox( NULL, "注册失败", "Error", MB_OK );
        return 0;
    }
    HWND hWnd = CreateMain( "Wnd", "Window" );
    Display( hWnd );
    Message( );
    return 0;
}
コード例 #4
0
ファイル: WinTimer.cpp プロジェクト: dekai-wang/TestCode
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    AllocConsole( );
    g_hOutput = GetStdHandle( STD_OUTPUT_HANDLE );
    g_hInstance = hInstance;
    if( !Register( "Wnd", WndProc ) )
    {
        MessageBox( NULL, "注册失败", "Error", MB_OK );
        return 0;
    }
    HWND hWnd = CreateMain( "Wnd", "Window" );
    Display( hWnd );
    Message( );
    return 0;
}
コード例 #5
0
ファイル: WinRes.cpp プロジェクト: dekai-wang/TestCode
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	g_hInstance = hInstance;
	if( !Register( "Wnd", WndProc ) )
	{
		MessageBox( NULL, "注册失败", "Error", MB_OK );
		return 0;
	}
	char szTitle[256] = { 0 };
	LoadString( g_hInstance, IDS_WND, szTitle, 256 );
	HWND hWnd = CreateMain( "Wnd", szTitle );
	Display( hWnd );
	Message( );
	return 0;
}
コード例 #6
0
ファイル: WinCreate.cpp プロジェクト: isongbo/MyCode
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	g_hInstance = hInstance;
	Register( "Main", WndProc );
	HWND hWnd = CreateMain( "Main", "window" );
	Register( "CHILD", DefWindowProc );
	HWND hChild1 = CreateChild( "CHILD", "C1", hWnd );
	HWND hChild2 = CreateChild( "CHILD", "C2", hWnd );
	Display( hWnd );
	MoveWindow( hChild1, 300, 100, 200, 200, TRUE );
	MoveWindow( hChild2, 500, 100, 200, 200, TRUE );
	SetExtra( hChild1 );
	GetExtra( hChild2 );
	Message( );
	return 0;
}