Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / April 2005



Tip: Looking for answers? Try searching our database.

Window is stuck as flashing in task bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Kaikow - 27 Apr 2005 12:07 GMT
I've got code that  creates a Word template and sets a project password.

I'm now trying to adapt the code to Excel.

Other than the few Word/Excel specific statements, I expect that all the
other
code will work as is.

But, there is one problem.

When Word displays the Project Properties dialog, Word plops it on the
screen in plain view.

However, Excel minimizes the dialog and flashes the task bar icon.

I've tried a few of the messages with ShowWindow, but no success.
How do I get the window to display normally?
MikeD - 28 Apr 2005 00:05 GMT
> I've got code that  creates a Word template and sets a project password.
>
[quoted text clipped - 13 lines]
> I've tried a few of the messages with ShowWindow, but no success.
> How do I get the window to display normally?

Sounds more like an issue of differences between Word and Excel automation
rather than a "VB issue".  Asking in Word/Excel/Office VBA programming
newsgroups is more likely to get you answers.

Signature

Mike
Microsoft MVP Visual Basic

Howard Kaikow - 28 Apr 2005 00:26 GMT
> > I've got code that  creates a Word template and sets a project password.
> >
[quoted text clipped - 17 lines]
> rather than a "VB issue".  Asking in Word/Excel/Office VBA programming
> newsgroups is more likely to get you answers.

It's an API issue.

I found a way to get the handle of the minimized window by using the caption
"TF_FloatingLangBar_WndTitle".
I then did a SetFocusAPI.
Followd that with a SW_Restore, but the only thing that got restored was a
small empty dialog (all fill color), which I can easily get rid of only by
rebooting.

That proved that I had the correct handle and that I could set the focus, so
the next thing I tried was the keybd_event to send a vbCr.

Alas, that did indeed send the code, but unlike a click with mouse, all it
does is cause an infinite loop creating clones of the icon.

So my next step was to try
           mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, curx,
cury, 0&, 0&
Again, this just resulted in an infinite loop creating clones of the icon.

Since I can right, or left, click on the icon, while the code is running, to
display the dialog, I expect that there is a way to do this with the API. So
far, no luck in finding the magic function or message.

It is necessary to show the dialog, otherwise, I cannot get access to the
dialog's handles.
"TF_FloatingLangBar_WndTitle" must be some magic caption. It's handle does
not allow me to get the handles of the dialog controls.

Well, I am a bit Lost now, so I guess I betta go watch Lost in a few
minutes, and I have not eaten in about 16 hours, so I betta also find my
fridge.
Howard Kaikow - 28 Apr 2005 04:37 GMT
Although I have not yet found a way to restore the minimized and flashing
icon, I found a way to prtevent te Project Properties dialog from being
minimized in the first place.

In the original Word version of the code, Word itself was minimized. Even
so, Word did not minimize the Project Properties dialog.

In the Excel version, apparently Excel does minimize the Project Properties
dialog if Excel is minimized.

Turns ot, at this point, it is not necessary t minimize either Word or
Excel, so after pulling the WindoeState setting, Excel does not minimize the
dialog.

However, I'd still like to know how to restore such a minimized dialog.
I'll play with that separately later.
TC - 28 Apr 2005 09:18 GMT
It still makes sense to ask again in a Word, Excel or VBA newsgroup.
Certain Office programs have VBA statements that might help. (Eg.
Access VBA's AppActivate.)

HTH,
TC
Howard Kaikow - 28 Apr 2005 12:00 GMT
> It still makes sense to ask again in a Word, Excel or VBA newsgroup.
> Certain Office programs have VBA statements that might help. (Eg.
> Access VBA's AppActivate.)

This app is automating Word from VB 6, it is an API issue as to how to show
the minimized window,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.