<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Change Background Color and center Dialog boxes in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Change-Background-Color-and-center-Dialog-boxes/m-p/864760#M70341</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i am programming a QuickWIN Application.&lt;BR /&gt;Sorry for the "simple" questions, but i am just learning to program apps.&lt;BR /&gt;&lt;BR /&gt;1. I want to change the background color of the child window from black to anything else...&lt;BR /&gt;I tried to use &lt;BR /&gt;&lt;BR /&gt;ibackcolor = rgb(255,255,255)&lt;BR /&gt;iret = SETBKCOLORRGB(ibackcolor)&lt;BR /&gt;&lt;BR /&gt; directly after the OPEN-command, but this does not work,&lt;BR /&gt;child window stays black..&lt;BR /&gt;&lt;BR /&gt;2. I want the dialog boxes to open centered to the frame window.&lt;BR /&gt;At the moment they open on the upper left corner.&lt;BR /&gt;Where do i have to add which code?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;Marco&lt;BR /&gt;</description>
    <pubDate>Fri, 03 Jul 2009 10:41:14 GMT</pubDate>
    <dc:creator>kaffee46</dc:creator>
    <dc:date>2009-07-03T10:41:14Z</dc:date>
    <item>
      <title>Change Background Color and center Dialog boxes</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Change-Background-Color-and-center-Dialog-boxes/m-p/864760#M70341</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i am programming a QuickWIN Application.&lt;BR /&gt;Sorry for the "simple" questions, but i am just learning to program apps.&lt;BR /&gt;&lt;BR /&gt;1. I want to change the background color of the child window from black to anything else...&lt;BR /&gt;I tried to use &lt;BR /&gt;&lt;BR /&gt;ibackcolor = rgb(255,255,255)&lt;BR /&gt;iret = SETBKCOLORRGB(ibackcolor)&lt;BR /&gt;&lt;BR /&gt; directly after the OPEN-command, but this does not work,&lt;BR /&gt;child window stays black..&lt;BR /&gt;&lt;BR /&gt;2. I want the dialog boxes to open centered to the frame window.&lt;BR /&gt;At the moment they open on the upper left corner.&lt;BR /&gt;Where do i have to add which code?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;Marco&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jul 2009 10:41:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Change-Background-Color-and-center-Dialog-boxes/m-p/864760#M70341</guid>
      <dc:creator>kaffee46</dc:creator>
      <dc:date>2009-07-03T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Background Color and center Dialog boxes</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Change-Background-Color-and-center-Dialog-boxes/m-p/864761#M70342</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/433404"&gt;kaffee46&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;2. I want the dialog boxes to open centered to the frame window.&lt;BR /&gt;At the moment they open on the upper left corner.&lt;BR /&gt;Where do i have to add which code?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;To learn Windows programming, read any of Petzold's older (pre-.NET) how-to books. Quickwin adds a layer of abstraction which &lt;EM&gt;subtracts&lt;/EM&gt; from the ability to develop full-featured F90 GUI programs -- there is no magic shortcut to avoid processing your own message loops. Here is how to center a child window on its parent (IFWIN and IFWINTY are assumed USEd module-local):&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]!
! Centers a child window on a parent window
SUBROUTINE CenterWindow (hwndChild, hwndParent)
    IMPLICIT NONE
    INTEGER(HANDLE), INTENT(IN)    :: hwndChild
    INTEGER(HANDLE), INTENT(IN)    :: hwndParent
    TYPE (T_RECT)                  :: rChild
    TYPE (T_RECT)                  :: rParent
    INTEGER                        :: wChild
    INTEGER                        :: hChild
    INTEGER                        :: wParent
    INTEGER                        :: hParent
    INTEGER                        :: wScreen
    INTEGER                        :: hScreen
    INTEGER                        :: xNew
    INTEGER                        :: yNew
    INTEGER                        :: hdc
    INTEGER                        :: retval

    ! Get the Height and Width of the child window
    retval = GetWindowRect(hwndChild, rChild)
    wChild = rChild.right - rChild.left
    hChild = rChild.bottom - rChild.top

    ! Get the Height and Width of the parent window
    retval  = GetWindowRect (hwndParent, rParent)
    wParent = rParent.right - rParent.left
    hParent = rParent.bottom - rParent.top

    ! Get the display limits
    hdc = GetDC (hwndChild)
    wScreen = GetDeviceCaps(hdc, HORZRES)
    hScreen = GetDeviceCaps(hdc, VERTRES)
    retval = ReleaseDC(hwndChild, hdc)

    ! Calculate new X position, then adjust for screen
    xNew = rParent.left + ((wParent - wChild) /2)
    IF (xNew .LT. 0) THEN
        xNew = 0
    ELSE IF ((xNew+wChild) .GT. wScreen) THEN
        xNew = wScreen - wChild
    END IF

    ! Calculate new Y position, then adjust for screen
    yNew = rParent.top  + ((hParent - hChild) /2)
    IF (yNew .LT. 0) THEN
        yNew = 0
    ELSE IF ((yNew+hChild) .GT. hScreen) THEN
        yNew = hScreen - hChild
    END IF

    ! Set it, and return
    retval = SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, &amp;amp;
						   IOR(SWP_NOSIZE , SWP_NOZORDER))

END SUBROUTINE CenterWindow


SUBROUTINE CenterDialog (hwnd)
    IMPLICIT NONE
    INTEGER(HANDLE), INTENT(IN)    :: hwnd
    CALL CenterWindow (hwnd, GetParent(hwnd))
END SUBROUTINE CenterDialog
[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jul 2009 16:36:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Change-Background-Color-and-center-Dialog-boxes/m-p/864761#M70342</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2009-07-03T16:36:01Z</dc:date>
    </item>
  </channel>
</rss>

