<?xml version="1.0" encoding="iso-8859-9" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwizguide.com/rss_namespace/">
 <channel>
  <title>Datakent Forum : bir form&#039;u diğer tüm açık pencerelerin üzerinde</title>
  <link>http://forum.datakent.com/</link>
  <description>XML içerik linki; Datakent Forum : Borland Delphi : bir form&#039;u diğer tüm açık pencerelerin üzerinde</description>
  <pubDate>Fri, 24 Apr 2026 18:07:16 +0000</pubDate>
  <lastBuildDate>Thu, 02 Feb 2012 19:23:41 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.54</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.datakent.com/RSS_post_feed.asp?TID=2303</WebWizForums:feedURL>
  <image>
   <title>Datakent Forum</title>
   <url>http://forum.datakent.com/forum_images/datakent.com_forums.png</url>
   <link>http://forum.datakent.com/</link>
  </image>
  <item>
   <title>bir form&#039;u diğer tüm açık pencerelerin üzerinde :   bir form&amp;#039;u veya uygulaman&#305;n...</title>
   <link>http://forum.datakent.com/forum_posts.asp?TID=2303&amp;PID=4891#4891</link>
   <description>
    <![CDATA[<strong>Yazar:</strong> <a href="http://forum.datakent.com/member_profile.asp?PF=1" rel="nofollow">murat turan</a><br /><strong>Konu:</strong> 2303<br /><strong>Gönderim Zamanı:</strong> 02.Subat.2012 Saat 19:23<br /><br />bir form'u veya uygulamanın kendisini&nbsp;diğer tüm açık pencerelerin (windowsda açık olan diğer tüm pencereler) üzerine getirmeknin <div>birkaç yolu;</div><div>&nbsp;</div><div><span ="sourcecode"><font size="2" face="Courier New"><font color="#000080"><i>{<br>  Windows 98/2000 doesn't want to foreground a window when<br>  some other window has the keyboard focus.<br>  ForceForegroundWindow is an enhanced SetForeGroundWindow/bringtofront<br>  function to bring a window to the front.<br>}<br><br><br>{<br>  Manchmal funktioniert die SetForeGroundWindow Funktion<br>  nicht so, wie sie sollte; besonders unter Windows 98/2000,<br>  wenn ein anderes Fenster den Fokus hat.<br>  ForceForegroundWindow ist eine "verbesserte" Version von<br>  der SetForeGroundWindow API-Funktion, um ein Fenster in<br>  den Vordergrund zu bringen.<br>}<br><br><br></i></font><b>function </b>ForceForegroundWindow(hwnd: THandle): Boolean;<br><b>const<br>  </b>SPI_GETFOREGROUNDLOCKTIMEOUT = $2000;<br>  SPI_SETFOREGROUNDLOCKTIMEOUT = $2001;<br><b>var<br>  </b>ForegroundThreadID: DWORD;<br>  ThisThreadID: DWORD;<br>  timeout: DWORD;<br><b>begin<br>  if </b>IsIconic(hwnd) <b>then </b>ShowWindow(hwnd, SW_RESTORE);<br><br>  <b>if </b>GetForegroundWindow = hwnd <b>then </b>Result := True<br>  <b>else<br>  begin<br>    </b><font color="#000080"><i>// Windows 98/2000 doesn't want to foreground a window when some other<br>    // window has keyboard focus<br><br>    </i></font><b>if </b>((Win32Platform = VER_PLATFORM_WIN32_NT) <b>and </b>(Win32MajorVersion &gt; 4)) <b>or<br>      </b>((Win32Platform = VER_PLATFORM_WIN32_WINDOWS) <b>and<br>      </b>((Win32MajorVersion &gt; 4) <b>or </b>((Win32MajorVersion = 4) <b>and<br>      </b>(Win32MinorVersion &gt; 0)))) <b>then<br>    begin<br>      </b><font color="#000080"><i>// Code from Karl E. Peterson, www.mvps.org/vb/sample.htm<br>      // Converted to Delphi by Ray Lischner<br>      // Published in The Delphi Magazine 55, page 16<br><br>      </i></font>Result := False;<br>      ForegroundThreadID := GetWindowThreadProcessID(GetForegroundWindow, <b>nil</b>);<br>      ThisThreadID := GetWindowThreadPRocessId(hwnd, <b>nil</b>);<br>      <b>if </b>AttachThreadInput(ThisThreadID, ForegroundThreadID, True) <b>then<br>      begin<br>        </b>BringWindowToTop(hwnd); <font color="#000080"><i>// IE 5.5 related hack<br>        </i></font>SetForegroundWindow(hwnd);<br>        AttachThreadInput(ThisThreadID, ForegroundThreadID, False);<br>        Result := (GetForegroundWindow = hwnd);<br>      <b>end</b>;<br>      <b>if not </b>Result <b>then<br>      begin<br>        </b><font color="#000080"><i>// Code by Daniel P. Stasinski<br>        </i></font>SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, @timeout, 0);<br>        SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, TObject(0),<br>          SPIF_SENDCHANGE);<br>        BringWindowToTop(hwnd); <font color="#000080"><i>// IE 5.5 related hack<br>        </i></font>SetForegroundWindow(hWnd);<br>        SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, TObject(timeout), SPIF_SENDCHANGE);<br>      <b>end</b>;<br>    <b>end<br>    else<br>    begin<br>      </b>BringWindowToTop(hwnd); <font color="#000080"><i>// IE 5.5 related hack<br>      </i></font>SetForegroundWindow(hwnd);<br>    <b>end</b>;<br><br>    Result := (GetForegroundWindow = hwnd);<br>  <b>end</b>;<br><b>end</b>; <font color="#000080"><i>{ ForceForegroundWindow }<br><br><br>// 2. Way:<br>//**********************************************<br><br></i></font><b>procedure </b>ForceForegroundWindow(hwnd: THandle);<br>  <font color="#000080"><i>// (W) 2001 Daniel Rolf<br>  // http://www.finecode.de<br>  // rolf@finecode.de<br></i></font><b>var<br>  </b>hlp: TForm;<br><b>begin<br>  </b>hlp := TForm.Create(<b>nil</b>);<br>  <b>try<br>    </b>hlp.BorderStyle := bsNone;<br>    hlp.SetBounds(0, 0, 1, 1);<br>    hlp.FormStyle := fsStayOnTop;<br>    hlp.Show;<br>    mouse_event(MOUSEEVENTF_ABSOLUTE <b>or </b>MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);<br>    mouse_event(MOUSEEVENTF_ABSOLUTE <b>or </b>MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);<br>    SetForegroundWindow(hwnd);<br>  <b>finally<br>    </b>hlp.Free;<br>  <b>end</b>;<br><b>end</b>;<br><br><font color="#000080"><i>// 3. Way:<br>//**********************************************<br>// by Thomas Stutz<br><br>{<br>  As far as you know the SetForegroundWindow function on Windows 98/2000 can<br>  not force a window to the foreground while the user is working with another window.<br>  Instead, SetForegroundWindow will activate the window and call the FlashWindowEx<br>  function to notify the user. However in some kind of applications it is necessary<br>  to make another window active and put the thread that created this window into the<br>  foreground and of course, you can do it using one more undocumented function from<br>  the USER32.DLL.<br><br>  void SwitchToThisWindow (HWND hWnd,  // Handle to the window that should be activated<br>  BOOL bRestore // Restore the window if it is minimized<br>);<br><br>}<br><br></i></font><b>procedure </b>SwitchToThisWindow(h1: hWnd; x: bool); <b>stdcall</b>;<br>  <b>external </b>user32 Name 'SwitchToThisWindow';<br>         <font color="#000080"><i>{x = false: Size unchanged, x = true: normal size}<br><br><br></i></font><b>procedure </b>TForm1.Button2Click(Sender: TObject);<br><b>begin<br>  </b>SwitchToThisWindow(FindWindow('notepad', <b>nil</b>), True);<br><b>end</b>;<br></font></span></div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Thu, 02 Feb 2012 19:23:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.datakent.com/forum_posts.asp?TID=2303&amp;PID=4891#4891</guid>
  </item> 
 </channel>
</rss>