在delphi中,创建一个窗体并编译后的EXE文件就达350KB,请问得怎么办才能编写一个含有窗体
且体积不超过100KB的文件呢?(我看过一些带有窗体的EXE文件才只有几十KB大小,请问得怎么办才能编写出这么小的文件)望请得到您的指教,谢谢!!!

解决方案 »

  1.   

    用dll关于delphi的专门压缩工具压缩一下,效率很高!ASPack、UPX等等
      

  2.   

    采用C++写吧,或者用Delphi采用纯API写也可以的(不会超过20K)
      

  3.   

    能给个用API编写的窗体文件的例子吗?
      

  4.   

    有些是用win32 汇编做的,全都是windows api调用,自然小得只有各位数。
      

  5.   

    program FirstWinMain;uses Windows,Messages;//窗口函数,窗口接到消息时被WINDOWS调用
    function WindowFunc(hwnd:HWND;uMsg:Cardinal;wParam:WPARAM;
     lParam:LPARAM):LResult;stdcall;
     begin
      Result := 0;
        case uMsg of    WM_CLOSE : PostMessage(hwnd, WM_QUIT, 0, 0);    else
            Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
        end;
    end;var
        wcl : WNDCLASS;
        hwnd : THandle;
        Msg : tagMSG;
    begin
       wcl.hInstance := hInstance; //将hThisInst所指定的当前实例的句柄赋给hInstance。
       wcl.lpszClassName := 'FirstWinMain'; //指向窗口类的名字
       wcl.lpfnWndProc := @WindowFunc; //窗口函数的地址被赋给lpfnWndProc
       wcl.style := 0; // default style
       wcl.hIcon := 0; //定义标准图标
      // wcl.hIconSm := 0;(呀,这个我忘了对应的Delphi里的小图标是什么去了)
       wcl.hCursor := LoadCursor(hInstance,'IDC_ARROW'); //读取鼠标光标
      
       wcl.lpszMenuName := nil; // no menu
       wcl.cbClsExtra := 0; // no extra information needed
       wcl.cbWndExtra := 0; // no extra information needed
       wcl.hbrBackground :=COLOR_WINDOWFRAME;  //框架所创建的背景颜色   // Register the window class.
       if RegisterClass(wcl) = 0 then
            Exit;   //创建窗口
       hwnd := CreateWindow(
         'FirstWinMain', // name of window class
         'Windows 98 Skeleton', //name of window
         WS_OVERLAPPEDWINDOW, // window style - normal
         Integer(CW_USEDEFAULT),
         Integer(CW_USEDEFAULT),
         Integer(CW_USEDEFAULT),
         Integer(CW_USEDEFAULT),
         0,
         0,
         hInstance,
         nil
        );    if hwnd=0 then
           Exit;   // Display the window.
      //显示窗口
      ShowWindow(hwnd, SW_SHOWNORMAL);
        UpdateWindow(hWnd);   // Create the message loop.
      //消息循环
      while GetMessage(msg, hwnd, 0, 0) do
      begin
         TranslateMessage(msg); // translate keyboard messages
         DispatchMessage(msg); // return control to Windows 98
      end;  end.