Article View: borland.public.cppbuilder.nativeapi
Article #9956Re: Run Once
From: JD
Date: Tue, 01 Jun 2004 08:48
Date: Tue, 01 Jun 2004 08:48
47 lines
2896 bytes
2896 bytes
"Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> wrote: >My expectations come from looking directly at the VCL source code. >UpdateWindowState() forces the WindowState property to be set to the current >state of the window: > > procedure TCustomForm.UpdateWindowState; > var > Placement: TWindowPlacement; > begin > if HandleAllocated then > begin > Placement.length := SizeOf(TWindowPlacement); > GetWindowPlacement(Handle, @Placement); > case Placement.showCmd of > SW_SHOWMINIMIZED: FWindowState := wsMinimized; > SW_SHOWMAXIMIZED: FWindowState := wsMaximized; > else > FWindowState := wsNormal; > end; > end; > end; That's not inconsistant with the results that I was getting. SW_SHOWMINIMIZED is set if the window is iconic and IsIconic always failed as did testing for wsMinimized (when the form was minimized to the taskbar). When I explicitly set the WindowState to wsMinimized, IsIconic returned true and wsMinimized was correctly evaluated but the form minimized not to the taskbar but instead above the Start button. If you look at WS_EX_APPWINDOW, you'll see that that exStyle is documented to forces a top-level window onto the taskbar when the window is minimized. I believe that the answer to what was happening is related some how to this. When I added it to the exStyle, the WindowState did evaluate as I expected but it had a side-effect of creating two program icons in the taskbar. I probably could have resolved this if I hadn't found a workable solution first. Did you even try any of the code that I posted? Hans did and he confirmed the same results so I'm not crazy!! ~ JD
Technical Details
Message-ID:
<40bc42cd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40b9cff4$1@newsgroups.borland.com> <k5ikb0dppip15jep979bhuf7g148fsp3lj@4ax.com> <40ba78cc$1@newsgroups.borland.com> <40ba7ce2$1@newsgroups.borland.com> <40ba7f15$1@newsgroups.borland.com> <40ba9d87$1@newsgroups.borland.com> <40bb3815$1@newsgroups.borland.com> <40bba7d2$1@newsgroups.borland.com> <40bbec83$1@newsgroups.borland.com> <40bc0835$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,55fa8aeaf57fcad1 X-Google-Attributes: gid10cc67,public From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: Re: Run Once Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 172.167.213.148 References: <40b9cff4$1@newsgroups.borland.com> <k5ikb0dppip15jep979bhuf7g148fsp3lj@4ax.com> <40ba78cc$1@newsgroups.borland.com> <40ba7ce2$1@newsgroups.borland.com> <40ba7f15$1@newsgroups.borland.com> <40ba9d87$1@newsgroups.borland.com> <40bb3815$1@newsgroups.borland.com> <40bba7d2$1@newsgroups.borland.com> <40bbec83$1@newsgroups.borland.com> <40bc0835$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <40bc42cd$1@newsgroups.borland.com> Date: 1 Jun 2004 01:48:13 -0700 X-Trace: newsgroups.borland.com 1086079693 207.105.83.66 (1 Jun 2004 01:48:13 -0700) Lines: 48 Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail