Thema Datum  Von Nutzer Rating
Antwort
06.09.2022 10:05:53 Hady
NotSolved
06.09.2022 10:17:23 volti
NotSolved
06.09.2022 10:27:30 Hady
NotSolved
06.09.2022 10:52:39 volti
NotSolved
09.09.2022 13:43:52 Andy
NotSolved
Blau Userform immer im Vordergrund
09.09.2022 15:22:39 volti
NotSolved
09.09.2022 15:31:00 volti
NotSolved
09.09.2022 15:51:45 Andy
NotSolved

Ansicht des Beitrags:
Von:
volti
Datum:
09.09.2022 15:22:39
Views:
368
Rating: Antwort:
  Ja
Thema:
Userform immer im Vordergrund

Hallo Andy,

das habe ich noch nicht gemacht. Ich kenne keine Funktion für Fenster in den Hintergrund senden.

Wenn ich so die API durchschaue, fällt mir nur HWND-BOTTOM ein, was nach Beschreibung von MS das richtige sein müsste, da es die Z-Reihenfolge ändert.

Kannst Du ja mal ausprobieren. Ansonsten gäbe es noch HideWindow, aber dann ist das Fenster ganz weg.

Oder über die Funktion ShowWindow das Fenster minimieren...

Code:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
Private Declare PtrSafe Function FindWindowA Lib "user32" ( _
        ByVal lpClassName As StringByVal lpWindowName As StringAs LongPtr

Private Declare PtrSafe Function SetWindowPos Lib "user32" ( _
        ByVal hwnd As LongPtrByVal hWndInsertAfter As LongPtr, _
        ByVal x As LongByVal y As LongByVal cx As LongByVal cy As Long, _
        ByVal wFlags As LongAs Long
Private Const HWND_BOTTOM = 1
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOP = 0
Private Const HWND_TOPMOST = -1
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOMOVE As Long = &H2
Private Const SWP_NOZORDER As Long = &H4
Private Const SWP_NOACTIVATE As Long = &H10
Private Const SWP_SHOWWINDOW As Long = &H40
Private Const SWP_HIDEWINDOW As Long = &H80
Dim miFlags As Long

Private Declare PtrSafe Function ShowWindow Lib "user32" ( _
        ByVal hwnd As LongPtrByVal nCmdShow As LongAs Long
Private Const SW_HIDE = 0
Private Const SW_MAXIMIZE = 3
Private Const SW_MINIMIZE = 6
Private Const SW_NORMAL = 1
Private Const SW_RESTORE = 9
Private Const SW_SHOW = 5

Private Sub UserForm_Activate()
'  ShowWindow Application.hwnd, SW_MINIMIZE
  miFlags = SWP_NOSIZE Or SWP_NOMOVE Or SWP_SHOWWINDOW
  SetWindowPos FindWindowA("ThunderDFrame", Me.Caption), HWND_BOTTOM0000, miFlags
'  SetWindowPos Application.hwnd, HWND_BOTTOM, 0, 0, 0, 0, miFlags
End Sub
_________
viele Grüße
Karl-Heinz

Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
06.09.2022 10:05:53 Hady
NotSolved
06.09.2022 10:17:23 volti
NotSolved
06.09.2022 10:27:30 Hady
NotSolved
06.09.2022 10:52:39 volti
NotSolved
09.09.2022 13:43:52 Andy
NotSolved
Blau Userform immer im Vordergrund
09.09.2022 15:22:39 volti
NotSolved
09.09.2022 15:31:00 volti
NotSolved
09.09.2022 15:51:45 Andy
NotSolved