Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Floating UserForm | Excel Programming | |||
Template Help Task Pane Appears When Workbook Is Open | Excel Discussion (Misc queries) | |||
Template Help Task Pane Appears When Workbook Is Open | Excel Programming | |||
Floating userform | Excel Programming | |||
'Floating' UserForm | Excel Programming |