in Search
ATTENTION: I've decided to put the upgrade on hold due to a compatibility issue of our server environment with the latest CS installer package. CS 2008 now requires SQL Server 2005 as the backend DB but our database server currenlty has SQL Server 2000 installed on it. I'll resume the upgrade once I figure out when Telligent is releasing a patch to the schema compatibility issue. For now, we will continue to use the old version of CS while waiting for the said patch. If you have any questions about this process, please don't hesitate to post them on our forums and I'll answer them as soon as I can. Thanks for your patience and support guys! I'll let you know as soon as this is resolved. - Keith Rull
Latest post 08-24-2008 9:43 PM by modchip. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-22-2008 12:25 AM

    • modchip
    • Top 10 Contributor
    • Joined on 02-09-2006
    • Ivalice
    • Posts 710
    • Points 10,110

    I Wanna Be "Always on Top"

    Hi all!

    Is there an API or something that would make a DIALOGBOX stay always on top? I have tried searching but I have found none... (Maybe because of poor searching skils).

    Thanks in advance!

    • Post Points: 20
  • 08-22-2008 1:02 AM In reply to

    • cvega
    • Top 10 Contributor
    • Joined on 11-24-2005
    • Posts 497
    • Points 8,455

    Re: I Wanna Be "Always on Top"

    After you've secured the window's handler (HWND) of your dialog, just call the SetWindowPos function:

    local rect: RECT

    invoke GetWindowRect, m_hWnd, addr rect
    invoke SetWindowPos, m_hWnd, HWND_TOPMOST, rect.left, rect.top, rect.right, rect.bottom, SWP_SHOWWINDOW

    Cheers,

    -chris

    Chris Vega This posting is provided "AS IS" with no warranties, and confers no rights My Weblog|Visit MSDN Community
    • Post Points: 20
  • 08-22-2008 1:21 AM In reply to

    • modchip
    • Top 10 Contributor
    • Joined on 02-09-2006
    • Ivalice
    • Posts 710
    • Points 10,110

    Re: I Wanna Be "Always on Top"

    Thanks for the quick reply!

    local rect: RECT

    invoke GetWindowRect, hWin, addr rect
    ; Gets the current teh screen coordinates of the dialog?

    invoke SetWindowPos, hWin, HWND_TOPMOST, rect.left, rect.top, rect.right, rect.bottom, SWP_SHOWWINDOW
    ; Sets the coordinates gathered from the line above, makes dialog topmost even when deactivated, and shows the the dialog?


    Yes my dialog stays on top.. but, I was wondering why it becomes larger than its original size...

    Thanks again!

     

    • Post Points: 20
  • 08-22-2008 3:20 AM In reply to

    • cvega
    • Top 10 Contributor
    • Joined on 11-24-2005
    • Posts 497
    • Points 8,455

    Re: I Wanna Be "Always on Top"

    Oops, sorry:

    I was using SetWindowPos to reset the size as well. Add SWP_NOMOVE and SWP_NOSIZE to uFlags and set all size arguments to 0 if you want just the "top most" flag set (HWND_TOPMOST):

    invoke SetWindowPos, hWin, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW or SWP_NOMOVE or SWP_NOSIZE

    This will do it.

    Note: HWND_TOPMOST is a window handle of the currently set on top most, and you are telling that SetWindowPost to "show the window on top of the current top most".

    Other handles are: HWND_BOTTOM, HWND_NOTOPMOST, HWND_TOP

    Enjoy,

    -chris

    Chris Vega This posting is provided "AS IS" with no warranties, and confers no rights My Weblog|Visit MSDN Community
    • Post Points: 20
  • 08-24-2008 9:43 PM In reply to

    • modchip
    • Top 10 Contributor
    • Joined on 02-09-2006
    • Ivalice
    • Posts 710
    • Points 10,110

    Re: I Wanna Be "Always on Top"

    Nice! I got it now...

    I figured that the size and location was being replaced by the values gathered from the GetWindowRect! So, since now that we are literally defining the coords and dimensions, then I could omit the GetWindowRect function right? :D

    Here's my code now;

    DlgProc proc uses ebx esi edi hWin:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
    ...

    .elseif uMsg==WM_COMMAND
            .if wParam==IDC_BUTTON_MAIN_SET
                invoke SetWindowPos, hWin, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE

    ...

    Now all i have to do is figure out how to correctly set it using checkboxes... pft!

    Thanks a lot chris! This helped me a lot!

    • Post Points: 5
Page 1 of 1 (5 items)