小编XBa*_*000的帖子

分配给Setparent(..)后Showmodal中的问题

我创建了两个应用程序MainApps和SubApps,SubApps有一个模态类型对话框,如登录/注销表单等,它的工作正常.

将其附加到MainApps后,"模态"对话框显示为普通的框形式.它的行为类似于"DIALOG.SHOW"而不是"DIALOG.SHOWMODAL";

我正在使用delphi编译器

SubApps按钮点击;

  begin
    with TfrmDialog.Create(Self, dtLogout) do
    try
      iMsgResult := ShowModal;
    finally
      Free;
    end;
    if iMsgResult = mrOk then
    begin
      dmVoca.FHomeworkXMLDoc.Active := False;
      //Disabled Double Login
      dmVoca.tmrDoubleLogin.Enabled := False;
      ................
    end;  
  end;
Run Code Online (Sandbox Code Playgroud)

MainApps ButtonClick

begin
setparent(findwindow(nil,'SubApps'),TabSheet1.Handle);
.........
end;
Run Code Online (Sandbox Code Playgroud)

forms delphi dialog modal-dialog setparent

3
推荐指数
1
解决办法
2200
查看次数

如何在单独的进程中使用SendMessage(..)发送数据记录

我用来发送两个独立进程的数据,但它失败了.它只在相同的过程下工作......这是概念.

// ------------------------------------------------ -----------------------------------
MainApps
// ------------ -------------------------------------------------- ---------------------

Type
   PMyrec = ^TMyrec; 
   TMyrec = Record
   name : string;
   add : string;
   age : integer;
end;

:OnButtonSend
var aData : PMyrec;
begin
   new(aData);
   aData.Name := 'MyName';
   aData.Add := 'My Address';
   aData.Age : 18;
   SendMessage(FindWindow('SubApps'),WM_MyMessage,0,Integer(@aData));
end;
Run Code Online (Sandbox Code Playgroud)

// ------------------------------------------------ -----------------------------------
SubApps
// ------------ -------------------------------------------------- ---------------------

Type
   PMyrec = ^TMyrec; 
   TMyrec = Record
   name : string;
   add : string;
   age : integer;
end;
Run Code Online (Sandbox Code Playgroud)

:OnCaptureMessage

var
  aData : PMyrec;
begin
  aData := PMyrec(Msg.LParam);
  showmessage(aData^.Name); …
Run Code Online (Sandbox Code Playgroud)

delphi process sendmessage windows-messages

3
推荐指数
1
解决办法
5889
查看次数

如何使用透明背景制作tmemo和Tedit?

如何使用透明背景制作tmemo和Tedit?或者在它的画布上添加图像背景.这在Delphi7中都可行

delphi transparency canvas onpaint

3
推荐指数
1
解决办法
2985
查看次数

从指针复制数据?

...
  PAnalyzeInfo = ^TAnalyzeInfo;
  TAnalyzeInfo = record
    pPitch: array of Single;
    pEnergy: array of Single;
    pPitchAccent: array of Single;
    pEnergyAccent: array of Single;
    pDicAccent: array of Single;
    pScore: array of Single;
    pBoundary: Integer;
    szRecWord: array of array of AnsiChar;
    nRecWordNum: Integer;
    nFrameNum: Integer;
  end;
...
Run Code Online (Sandbox Code Playgroud)

我有pDataSource: PAnalyzeInfo包含数据,我想将其复制到一个新的自变量.MyData : TAnalyzeInfo.

是否可以复制整个结构或逐个添加?

delphi pointers copy record

3
推荐指数
1
解决办法
3480
查看次数

功能从C到Delphi

我在delphi代码中创建了一个类似的函数.但它不会工作.转换它的正确方法是什么?

char* ReadSpeechFile(char* pFileName, int *nFileSize)
{
    char *szBuf, *pLinearPCM;   
    int nSize;
    FILE* fp;

    //read wave data
    fp = fopen(pFileName, "rb");
    if(fp == NULL)
        return NULL;
    fseek(fp, 0, SEEK_END);
    nSize = ftell(fp);

    //linear
    szBuf = (char *)calloc(nSize, sizeof(char));
    fseek(fp, 0, SEEK_SET);
    fread(szBuf, sizeof(char), nSize, fp);
    fclose(fp);

    *nFileSize = nSize;

    return szBuf;
}
Run Code Online (Sandbox Code Playgroud)

c delphi

2
推荐指数
1
解决办法
495
查看次数

如何获得dos输出.在delphi2009中使用vista

我用delphi来获取dos输出.
导致http://delphi.about.com/cs/adptips2001/a/bltip0201_2.htm的代码无法在vista上使用delphi2009?但它适用于XP中的D7.我不知道要修改哪个部分才能使其工作.

delphi

2
推荐指数
1
解决办法
1520
查看次数

如何确定Tpicture是否包含Jpeg?

我正在使用delphi7/2009.如何确定Tpicture的内容?jpeg bmp png等?

delphi image

2
推荐指数
1
解决办法
909
查看次数

还有其他方法可以在delphi上查看youtube视频吗?

我在http://www.delphiflash.com/demo-youtube-video上看到如何在delphi上加载flash视频,但它不是免费的.还有其他方法吗?

喜欢HTML然后TWebBroeser?

sampleVideo.html //这对TwebBrowser不起作用还有其他方法吗?

<html>
<head>
</style> 
    <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> 
</head>
<body>
  <object width="640" height="390">
  <param name="movie" value="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3">
  </param><param name="allowFullScreen" value="true">
  </param><param name="allowScriptAccess" value="always">
  </param><embed src="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390">
  </embed></object>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

youtube delphi flash video activex

2
推荐指数
1
解决办法
6002
查看次数

如何在RichEdit上捕获OnScroll事件?

我创建了一个自定义Rich,它有一个scrollPos事件.

所以我有这个代码:

procedure TCustomRich.WMVScroll(var Msg : TWMVScroll);
begin
  inherited;
  if (Msg.ScrollCode in [SB_THUMBTRACK, SB_THUMBPOSITION]) then
    FScrollY := Msg.Pos;
  if Assigned(OnScroll) then
    OnScroll(Self, FScrollX, FScrollY);
end;

procedure TCustomRich.WMHScroll(var Msg : TWMVScroll);
begin
  inherited;
  if (Msg.ScrollCode in [SB_THUMBTRACK, SB_THUMBPOSITION]) then
    FScrollX := Msg.Pos;
  if Assigned(OnScroll) then
    OnScroll(Self, FScrollX, FScrollY);
end;
Run Code Online (Sandbox Code Playgroud)

但问题是当它使用键或鼠标滚轮滚动时不会触发.

windows delphi events message

2
推荐指数
1
解决办法
1145
查看次数

C头到delphi

我有一段C代码.我需要帮助才能将其翻译成Delphi代码.

1)

/*
 * Color is packed into 16-bit word as follows:
 *
 *  15      8 7      0 
 *   XXggbbbb XXrrrrgg
 *
 * Note that green bits 12 and 13 are the lower bits of green component
 * and bits 0 and 1 are the higher ones.
 * 
 */
#define CLR_RED(spec)      (((spec) >> 2) & 0x0F)
#define CLR_GREEN(spec)    ((((spec) & 0x03) << 2) | ((spec & 0x3000) >> 12))
#define CLR_BLUE(spec)     (((spec) >> 8) & 0x0F)
Run Code Online (Sandbox Code Playgroud)

2)

#define CDG_GET_SCROLL_COMMAND(scroll)    (((scroll) …
Run Code Online (Sandbox Code Playgroud)

c delphi

2
推荐指数
1
解决办法
182
查看次数