Announcement

Collapse
No announcement yet.

SetDialogFocus (does this exist?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jeff Blakeney
    replied
    Keep in mind that even the Windows API help file suggests that, in general, you shouldn't use the SetForegroundWindow function but let the user choose which window is in the foreground. There are times when it might be necessary but usually, you shouldn't need this. Many applications now simply flash the window and the taskbar button, using something like the FlashWindow API function, to let the user know that something has changed and then the user can switch to the window themselves.

    Leave a comment:


  • Mike Doty
    replied
    This is Gosta's app. See post #24 and after.
    What I would like to do is to force the Dialog to the top when the timer runs out but I dont know how to do that. I fooled with Dialog styles but no go.
    http://www.powerbasic.com/support/pb...ad.php?t=41701


    My suggestion was to use DIALOG SHOW STATE hDlg, %SW_SHOWNORMAL in case minimized
    and SetForegroundWindow(hDlg) in case behind another window.
    Last edited by Mike Doty; 20 Oct 2009, 07:33 PM.

    Leave a comment:


  • Dominic Mitchell
    replied
    That's too vague.
    Usually to show or hide a window only the SDK's ShowWindow or PB's verbose Dialog Show State is needed.
    Why do you need SetForegroundWindow? I am trying to figure out the context in which the dialog is being
    made visible.
    Is it at application startup?
    Is it after the dialog has been minimized to the system tray?
    Are you trying to forcefully grab the foreground from another app?

    Leave a comment:


  • Mike Doty
    replied
    Make dialog visible.

    Leave a comment:


  • Dominic Mitchell
    replied
    What are you trying to do?

    Leave a comment:


  • Mike Doty
    replied
    Thank you.

    How about this?
    Code:
    DIALOG SHOW STATE hDlg, %SW_SHOWNORMAL 'in case minimized
    SetForegroundWindow(hDlg)

    Leave a comment:


  • Dominic Mitchell
    replied
    No.

    SetDialogFocus is just a wrapper made up by Raymond Chen for the WM_NEXTDLGCTL message.
    A similar wrapper in PowerBASIC would be
    Code:
    SUB SetDialogFocus(BYVAL hdlg AS DWORD, BYVAL hwndControl AS DWord)
    
      SendMessage(hdlg, %WM_NEXTDLGCTL, hwndControl, %TRUE)
    
    END SUB

    Leave a comment:


  • Mike Doty
    started a topic SetDialogFocus (does this exist?)

    SetDialogFocus (does this exist?)

    http://blogs.msdn.com/oldnewthing/ar...02/205624.aspx
Working...
X