🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15399

Re: A very strange question

#15399
From: Troels Jakobsen
Date: Fri, 04 Jul 2003 06:51
48 lines
2699 bytes
I'm guessing form1's Visible property is false.
In that case it won't redraw its controls, even though it actually
is visible.

If you can find a way to set Form1->Visible to true and perhaps
call its Application->Restore at the time the form is shown,
I think it will work properly.

Troels


HuangC wrote in message <3f03f89d$1@newsgroups.borland.com>...
>hi all,
>
>a strange question,
>I created a simple application with only one window named Form1,
>the form's WindowState has been set to wsMinimized,
>then add some simple controls on it.
>this is the first instance.
>
>in another instance
>create a simple application with only one window too(named Form2),
>I add three button on it, the following three line
>is the event handle function of each button.
>HWND hWnd = FindWindow(NULL, "Form1"); if (hWnd != NULL)
>
>SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);// Button1OnClick
>SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);// Button2OnClick
>SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0); // Button3OnClick
>
>when the first instance run, it was minimized automatical,
>don't hit it from the taskbar, run the second program,
>Click button1 or button2, the form1 will maximize or restore,
>but the controls added before were disappeared.
>however if i hit the iconic in the taskbar, it's OK, Why?
>
>Another similar question,
>Don't set the WindowState wsMinimized first,
>the other conditions were same as above,
>
>click button2 first in form2, form1 minimized ok,
>click button1 or button3 in form2, form1 maximized or restore ok,
>click button2 again, failed, do not respond,
>even click the minimize button in the title bar, why?
>
>WinXP Profession/P4 1.8G/512M
>
>do you meet the same things?
Technical Details
Message-ID: <3f0523db@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f03f89d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,3047a8fdb7c36cf1
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-04 00:09:36 PST
From: "Troels Jakobsen" <dont@like.spam>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f03f89d$1@newsgroups.borland.com>
Subject: Re: A very strange question
Date: Fri, 4 Jul 2003 08:51:05 +0200
Lines: 50
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
NNTP-Posting-Host: 80.196.79.114
Message-ID: <3f0523db@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1057301467 80.196.79.114 (3 Jul 2003 23:51:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail