🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

A very strange question

#15524
From: HuangC
Date: Thu, 03 Jul 2003 09:32
36 lines
2362 bytes
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: <3f03f89d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,3047a8fdb7c36cf1,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-03 02:39:32 PST
Reply-To: "HuangC" <HuangC@motic.com.cn>
From: "HuangC" <HuangC@motic.com.cn>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: A very strange question
Date: Thu, 3 Jul 2003 17:32:55 +0800
Lines: 38
Organization: Motic
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 218.104.133.50
Message-ID: <3f03f89d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1057224861 218.104.133.50 (3 Jul 2003 02:34:21 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail