生成加载画面

program SplashDemo;

uses
  Forms,
  Windows,
  Controls,
  Messages,
  Main in 'Main.pas',
  Splash in 'Splash.pas' {frmSplash};//这个窗体是最先弹出的窗体

{$R *.res}

var
  hMutex: THandle;
  FoundWnd: THandle;
  ModuleName: string;

function EnumWndProc(hwnd: THandle; Param: Cardinal): Bool; stdcall;
//列表并且得到最初的第一个窗口实例的句柄,赋值给FoundWnd
var
  ClassName, WinModuleName: string;
  WinInstance: THandle;
begin
  Result := True;
  SetLength(ClassName, 100);
  GetClassName (hwnd, PChar (ClassName), Length (ClassName));
  ClassName := PChar(ClassName);
  if ClassName = TfrmMain.ClassName then
  begin
    {10 获取目标窗口的模块名 }
    SetLength(WinModuleName, 200);
    WinInstance := GetWindowLong(hwnd, GWL_HINSTANCE);
    GetModuleFileName (WinInstance, PChar (WinModuleName),
      Length(WinModuleName));
    WinModuleName := PChar(WinModuleName); // 调整长度

    {20 比较模块名 }
    if WinModuleName = ModuleName then
    begin
      FoundWnd := Hwnd;
      Result := False; // 如果已找到,停止继续列举
    end;
  end;
end;

begin
  {10 检测是否互斥已存在 }
  HMutex := CreateMutex(nil, False, 'OneCopyMutex');
  if WaitForSingleObject(hMutex, 0) <> WAIT_TIMEOUT then
  begin
    Application.Initialize;

    {10.1 启动Splash屏幕 }
    frmSplash := TfrmSplash.Create(nil);
    try
      with frmSplash do
      begin
        BeginLoad;

        {10.2 装载主窗体}
        Application.CreateForm(TfrmMain, frmMain); //切记:需要将主窗体的VISBLE:=FALSE;
        Application.CreateForm(TfrmSplash, frmSplash);
        UpdateLoadStatus('正在载入启动参数', 10);

        {10.3 载入数据1的过程 }
        //LoadSomeData1;
        UpdateLoadStatus('正在载入数据1', 20);

        {10.4 装载其他数据 }
        //LoadSomeData2;
        UpdateLoadStatus('载入其他数据2', 40);
        //LoadSomeData3;
        UpdateLoadStatus('开始装载数据3', 60);
        //LoadSomeData4;
        UpdateLoadStatus('开始装载数据4', 70);
        //LoadSomeData5;
        UpdateLoadStatus('开始装载数据5', 80);
        //LoadSomeData6;
        UpdateLoadStatus('开始装载数据6', 90);
        {// 结束 }

        {10.5 装载完毕 }
        frmSplash.EndLoad;
      end;
    finally
      frmSplash.Free;
    end;
    Application.Run;
  end
  else
  begin
    {20 获取当前模块名 }
    SetLength(ModuleName, 200);
    GetModuleFileName (HInstance, PChar(ModuleName), Length (ModuleName));
    ModuleName := PChar(ModuleName); // 调整长度

    {30 列表最初实例的窗口 }
    EnumWindows(@EnumWndProc, 0);
    if FoundWnd <> 0 then
    begin
      {40 最后显示最初实例的窗口 }
      if not IsWindowVisible(FoundWnd) then
        PostMessage(FoundWnd, wm_App, 0, 0);
      SetForegroundWindow(FoundWnd);
    end;
end;
end.

jsp画面加载问题

08-23

一个测试画面,代码如下:rn[code=HTML]<%@ page contentType = " text/html;charset=gb2312" %>rn rnrnrn Test Actionrn rnrn<%rnString name = null;rnif (session.getAttribute("name")! = null )rn name = ( String )session.getAttribute("name");rnString host = java.net.InetAddress.getLocalHost().toString();rn%>rnrn rn rnrn The host is :<%=host %> rn Your session id is :<%=session.getId() %> rn Your session detail is :<%=session.toString() %> rn Your session context is :<%=session.getSessionContext() %> rn<%rnif (name! = null )rn out.print( " Your name is " + name + " " );rn out.print( " The session is valid. " );rnelsern out.print( " The session is invalid!!! " );rnrn%>rnReturn!rnrnrn<%rnif (session.getAttribute("name")! = null )rn session.invalidate();rn%>rnrn[/code]rn这个画面是从另外一个画面跳转过来的,第一个画面显示正常,这个画面报错,由于对jsp不是很了解,请大家指点一下!谢谢!rnrn报错信息如下:rnrn11:37:15,392 ERROR [[jsp]] Servlet.service() for servlet jsp threw exceptionrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 8 in the jsp file: /test/session.jsprnGenerated servlet error:rnSyntax error on tokens, they can be merge to form !=rnrnAn error occurred at line: 22 in the jsp file: /test/session.jsprnGenerated servlet error:rnSyntax error on tokens, they can be merge to form !=rnrnAn error occurred at line: 33 in the jsp file: /test/session.jsprnGenerated servlet error:rnSyntax error on tokens, they can be merge to form !=rnrnrn at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrornrHandler.java:84)rn at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试