Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 312071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:58:57+00:00 2026-05-12T07:58:57+00:00

I’m using Peter Below’s PBThreadedSplashForm to display during application startup. It gets updated as

  • 0

I’m using Peter Below’s PBThreadedSplashForm to display during application startup. It gets updated as various databases are opened during the creation of the data module (just before the main form is created).

The problem is that we have a check for the existence of certain things that is done during the creation of the data module. If any of those items are missing, a modal dialog is shown so that either the item can be created or the application closed. (The missing items are typically indexes, and the dialog is primarily used when we reindex databases, so it’s aimed at the developers and not normal users.) However, the modal dialog is displayed behind the splash screen; it appears to be the focused window, as the caption changes, but it displays behind the splash screen.

The splash screen is created using the Windows API CreateWindowEx() from a different thread than the main process, using the following code:

procedure TPBSplashThread.CreateSplashWindow;
const
  TopmostStyle: Array [Boolean] of DWORD = (0, WS_EX_TOPMOST );
  NoActivateStyle : Array [Boolean] of DWORD = (0, WS_EX_NOACTIVATE );
var
  wsize: TSize;
begin
  wsize.cx := FSurface.Width + GetSystemMetrics( SM_CXEDGE ) * 2;
  wsize.cy := FSurface.Height + GetSystemMetrics( SM_CYEDGE ) * 2;
  FWnd := CreateWindowEx(
            TopmostStyle[ FTopmost ] or WS_EX_TOOLWINDOW
            or WS_EX_STATICEDGE or WS_EX_CLIENTEDGE
            or NoActivateStyle[ Win32MajorVersion >= 5 ],
            MakeIntResource( FWndClass ),
            nil,
            WS_POPUP or WS_BORDER,
            Forigin.x, Forigin.y,
            wsize.cx, wsize.cy,
            0, 0, hInstance, self );
  If FWnd = 0 Then
    raise exception.create('TPBSplashThread.CreateSplashWindow: CreateWindowEx failed');
end;

FTopmost is a property (with the obvious meaning) that is never set, so it’s False due to the default initialization during class construction. (I’ve also tried explicitly setting it to False, just in case, with no effect.) I’ve also tried using SetForegroundWindow() and SetWindowPos() during the OnShow event of the modal dialog with no effect.

Does anyone have any idea what might be causing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:58:57+00:00Added an answer on May 12, 2026 at 7:58 am

    Ok. Finally got the problem solved. It appears to be caused by the WS_EX_NOACTIVATE flag in the call to CreateWindowEx(). Changing it to remove that seems to solve the problem; the modal dialog displays above the splash screen, and because it’s modal the splash screen can’t be brought above it.

    The working code is:

    
      FWnd := CreateWindowEx(
                TopmostStyle[ FTopmost ] or WS_EX_TOOLWINDOW
                or WS_EX_STATICEDGE or WS_EX_CLIENTEDGE,
                MakeIntResource( FWndClass ),
                nil,
                WS_POPUP or WS_BORDER,
                Forigin.x, Forigin.y,
                wsize.cx, wsize.cy,
                0, 0, hInstance, self );
    

    Thanks, Rob and Craig, for the efforts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.