Delphi 창 메시지

1952 단어
function TCmdEbookMin.Execute: string;
//  var
//  hHandle           : HWND;
begin
  //hHandle := Application.MainForm.Handle;
  //PostMessage(hHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
  Application.Minimize;
end;
case Message.msg of
    WM_COPYDATA:
      begin
        str := StrPas(PChar(PCopyDataStruct(Message.lparam)^.lpData));
        outputArgs := SplitString(str, '|');
        if outputArgs.Count > 0 then
        begin
          if outputArgs[0] = 'getres' then

            DownloadCallback(str)
          else if outputArgs[0] = 'uploadres' then
            UploadCallback(str);

          if outputArgs.Count <> 2 then
          begin
            Exit;
          end;

          if outputArgs[0] = 'videocap' then
          begin
            if (outputArgs[0] = 'videocap') and (outputArgs[1] = 'nocamera') then
            begin
              ShowMessage('         !');
              Exit;
            end;

            data := outputArgs[1];
            VideoCapCallback(data);
          end;
        end;

        outputArgs.Free;
      end;
  end;
  inherited;
var
  SL                : TStringList;
  msg               : string;
  head              : string;
  msglen            : Integer;
  hAgent            : HWND;
  ds                : TCopyDataStruct;
begin
  if combobox_Cams.Items[0] = 'NoCamera' then
  begin
    head := 'videocap|';
    msg := head + 'nocamera';
    msglen := Length(msg);
    // IflybooFrom      
    hAgent := FindWindow('TiflyBookForm', nil);

    if hAgent <> 0 then
    begin
      ds.dwData := 0;
      ds.cbData := msglen * 2 + 2;
      ds.lpData := PChar(msg);
      SendMessage(hAgent, WM_COPYDATA, 0, Cardinal(@ds));
    end;

    Self.Close;
    VideoImage.VideoStop;
    Exit;
  end;

좋은 웹페이지 즐겨찾기