Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Floating userform appears on task bar???

I am creating a special floating type of Userform using the
code and declarations below:

--------------------------------------------------------------------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub
-------------------------------------------------------------------------------

Then I load the form using the following call:

UserForm1.Show vbModeless

I like how this code works, but I really hate the fact that my floating
Userform
gets displayed in the Windows taskbar along with other running applications.
Is there any way to change the code above so that my Userform dialog box
doesnt show up in the taskbar??

Thank you!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating userform appears on task bar???


A userform has a startup position property which you can either manually
set or set prgrammably. the proptery has these options

Manual = 0 - No initial setting specified.
CenterOwner = 1 - Center on the item to which the UserForm belongs.
CenterScreen = 2 - Center on the whole screen.
WindowsDefault = 3 - Position in upper-left corner of screen.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160007

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Floating userform appears on task bar???

I wasnt really concerned about the position on the screen. I was wondering
about setting a property that prevents the Userform from having
an associated icon on the taskbar. Most dialog boxes do not appear in the
taskbar which allows the user to switch back to it..... I was wondering
if I could create my userform like that?

"joel" wrote in message
...

A userform has a startup position property which you can either manually
set or set prgrammably. the proptery has these options

Manual = 0 - No initial setting specified.
CenterOwner = 1 - Center on the item to which the UserForm belongs.
CenterScreen = 2 - Center on the whole screen.
WindowsDefault = 3 - Position in upper-left corner of screen.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating userform appears on task bar???


I'm not sure what is creating the window "ThunderDFrame". th e code you
posted I believe is just finding the window that was previously created.
the creation of the window caused the process to show up as a task.
I'm not sure if there is a way of creating a window without creating a
task. You can create a process without creating a task. But you would
need to create a HWND for the userform to work properly.

Again I'm not sure that you can create a window without creating a
task. I haven't done this type of programming in a long time and don't
remember all the answers.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160007

Microsoft Office Help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default Floating userform appears on task bar???

You don't need to call SetWindowLong when showing a form modelessly.
SetWindowLong in this case is changing the parent of the modeless form
from the Excel window to (I think) the desktop window, meaning it will
then show up on the taskbar.

Remove the SetWindowLong call, and your problem will go away.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Robert Crandal wrote:
I am creating a special floating type of Userform using the
code and declarations below:

--------------------------------------------------------------------------------

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub
-------------------------------------------------------------------------------


Then I load the form using the following call:

UserForm1.Show vbModeless

I like how this code works, but I really hate the fact that my floating
Userform
gets displayed in the Windows taskbar along with other running
applications.
Is there any way to change the code above so that my Userform dialog box
doesnt show up in the taskbar??

Thank you!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Floating userform appears on task bar???

That almost worked. You see, whenever someone minimizes the
Excel application I want my popup Userform to remain visible
on the screen. If I remove the call to "SetWindowLong", then
my Userform will get minimized as well.

So.... I guess my problem is two-fold. I want a popup Userform
that does the following:

1) Remains visible when Excel is minimized

AND

2) The popup form must not create an additional "switch to" icon
for itself on the task bar.

Do you know if a Userform can have both of these properties??

thank you


"Jon Peltier" wrote in message
...
You don't need to call SetWindowLong when showing a form modelessly.
SetWindowLong in this case is changing the parent of the modeless form
from the Excel window to (I think) the desktop window, meaning it will
then show up on the taskbar.

Remove the SetWindowLong call, and your problem will go away.

- Jon
-------

Robert Crandal wrote:
I am creating a special floating type of Userform using the
code and declarations below:

--------------------------------------------------------------------------------

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub
-------------------------------------------------------------------------------


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Floating userform appears on task bar???

It sounds to me like you want complete detachment.

You could write an external winforms app, and execute it via shell or dll calls.
The trouble might be in returning data from the form back to Excel.



Robert Crandal wrote:
That almost worked. You see, whenever someone minimizes the
Excel application I want my popup Userform to remain visible
on the screen. If I remove the call to "SetWindowLong", then
my Userform will get minimized as well.

So.... I guess my problem is two-fold. I want a popup Userform
that does the following:

1) Remains visible when Excel is minimized

AND

2) The popup form must not create an additional "switch to" icon
for itself on the task bar.

Do you know if a Userform can have both of these properties??

thank you


"Jon Peltier" wrote in message
...
You don't need to call SetWindowLong when showing a form modelessly.
SetWindowLong in this case is changing the parent of the modeless form
from the Excel window to (I think) the desktop window, meaning it will
then show up on the taskbar.

Remove the SetWindowLong call, and your problem will go away.

- Jon
-------

Robert Crandal wrote:
I am creating a special floating type of Userform using the
code and declarations below:

--------------------------------------------------------------------------------


Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub
-------------------------------------------------------------------------------



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating userform appears on task bar???


What about writing it as an IE application in Java?


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160007

Microsoft Office Help

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating UserForm Eric[_35_] Excel Programming 4 April 5th 07 03:50 AM
Template Help Task Pane Appears When Workbook Is Open Connie Excel Discussion (Misc queries) 2 November 8th 06 09:06 PM
Template Help Task Pane Appears When Workbook Is Open Connie Excel Programming 0 November 8th 06 05:10 AM
Floating userform MD Excel Programming 1 March 2nd 05 03:24 AM
'Floating' UserForm paulw Excel Programming 2 October 29th 03 04:48 PM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"